diff options
author | Nguyễn Gia Phong <cnx@loang.net> | 2025-06-18 16:29:13 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <cnx@loang.net> | 2025-06-18 16:29:13 +0900 |
commit | 2ad9177830e41802b673d1fe513bca883c5e496b (patch) | |
tree | 10c364208340ae5404b46e06efe932e3649735f9 /tst/test_help.py | |
parent | 63f17a58145b827a56c4963ad306157cf2dff887 (diff) | |
download | scadere-2ad9177830e41802b673d1fe513bca883c5e496b.tar.gz |
Follow help2man's recommendations
* Use argv[0] as help text's prog * End help text with bug report instruction * Include copyright and authorship in version text
Diffstat (limited to 'tst/test_help.py')
-rw-r--r-- | tst/test_help.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tst/test_help.py b/tst/test_help.py index 2a6c06a..630fff1 100644 --- a/tst/test_help.py +++ b/tst/test_help.py @@ -59,9 +59,11 @@ def test_long_option(help_string, short, long, metavar): @mark.parametrize('help_string', [check, listen], indirect=True) def test_examples(help_string): - index = help_string.find('\n\nExamples:\n') - assert index >= 0 - lines = help_string[index:].removeprefix('\n\nExamples:\n').splitlines() + epilog_index = help_string.find('\n\nExamples:\n') + assert epilog_index >= 0 + epilog = help_string[epilog_index:].removeprefix('\n\n') + examples = epilog[:epilog.find('\n\n')] + lines = examples.removeprefix('Examples:\n').splitlines() assert EXAMPLE_DESCRIPTION_PREFIX.startswith(EXAMPLE_PREFIX) assert not lines[0].startswith(EXAMPLE_DESCRIPTION_PREFIX) |