Skip to content

Commit d30ebee

Browse files
committed
Add reproducer for issue 1195
1 parent d7a7589 commit d30ebee

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/messages/test_extract.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,3 +561,21 @@ def test_f_strings_non_utf8(self):
561561
messages = list(extract.extract('python', buf, extract.DEFAULT_KEYWORDS, [], {}))
562562
assert len(messages) == 1
563563
assert messages[0][1] == 'åäöÅÄÖ'
564+
565+
566+
def test_issue_1195():
567+
buf = BytesIO(b"""
568+
foof = {
569+
'test_string': StringWithMeta(
570+
# NOTE: Text describing a test string
571+
string=_(
572+
'Text string that is on a new line'
573+
),
574+
),
575+
}
576+
""")
577+
messages = list(extract.extract('python', buf, {'_': None}, ["NOTE"], {}))
578+
message = messages[0]
579+
assert message[0] in (5, 6) # Depends on whether #1126 is in
580+
assert message[1] == 'Text string that is on a new line'
581+
assert message[2] == ['NOTE: Text describing a test string']

0 commit comments

Comments
 (0)