Skip to content

Commit 7b98ba8

Browse files
committed
Test multiple comment tags
1 parent aef1e0b commit 7b98ba8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Lib/test/test_tools/test_i18n.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,23 @@ def test_extract_all_comments(self):
447447
'''), args=(arg,), raw=True)
448448
self.assertIn('#. Translator comment', data)
449449

450+
def test_comments_with_multiple_tags(self):
451+
"""
452+
Test that multiple --add-comments tags can be specified.
453+
"""
454+
for arg in ('--add-comments={}', '-c{}'):
455+
with self.subTest(arg=arg):
456+
args = (arg.format('foo:'), arg.format('bar:'))
457+
data = self.extract_from_str(dedent('''\
458+
# foo: comment
459+
_("foo")
460+
461+
# bar: comment
462+
_("bar")
463+
'''), args=args, raw=True)
464+
self.assertIn('#. foo: comment', data)
465+
self.assertIn('#. bar: comment', data)
466+
450467

451468
def update_POT_snapshots():
452469
for input_file in DATA_DIR.glob('*.py'):

0 commit comments

Comments
 (0)