Skip to content

Commit d9ae563

Browse files
committed
Test comments are not extracted unless a tag is given
1 parent 7b98ba8 commit d9ae563

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Lib/test/test_tools/test_i18n.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,17 @@ def test_comments_with_multiple_tags(self):
464464
self.assertIn('#. foo: comment', data)
465465
self.assertIn('#. bar: comment', data)
466466

467+
def test_comments_not_extracted_without_tags(self):
468+
"""
469+
Test that translator comments are not extracted without
470+
specifying --add-comments.
471+
"""
472+
data = self.extract_from_str(dedent('''\
473+
# Translator comment
474+
_("foo")
475+
'''), raw=True)
476+
self.assertNotIn('#.', data)
477+
467478

468479
def update_POT_snapshots():
469480
for input_file in DATA_DIR.glob('*.py'):

0 commit comments

Comments
 (0)