Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lib/test/test_tools/test_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,12 @@ def test_files_list(self):
self.assertIn(f'msgid "{text2}"', data)
self.assertNotIn(text3, data)

def test_help_text(self):
"""Test that the help text is displayed."""
res = assert_python_ok(self.script, '--help')
self.assertEqual(res.out, b'')
self.assertIn(b'pygettext -- Python equivalent of xgettext(1)', res.err)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only test that the --help argument works, not that the help text matches a snapshot exactly, though I can add it



def update_POT_snapshots():
for input_file in DATA_DIR.glob('*.py'):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the keyword entry in the help output of :program:`pygettext`.
5 changes: 3 additions & 2 deletions Tools/i18n/pygettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
-k word
--keyword=word
Keywords to look for in addition to the default set, which are:
%(DEFAULTKEYWORDS)s
_, gettext, ngettext, pgettext, npgettext, dgettext, dngettext,
dpgettext, and dnpgettext.

You can have multiple -k flags on the command line.

Expand Down Expand Up @@ -171,7 +172,7 @@


def usage(code, msg=''):
print(__doc__ % globals(), file=sys.stderr)
print(__doc__, file=sys.stderr)
if msg:
print(msg, file=sys.stderr)
sys.exit(code)
Expand Down
Loading