From 2ad9177830e41802b673d1fe513bca883c5e496b Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 18 Jun 2025 16:29:13 +0900 Subject: 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 --- tst/test_help.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tst/test_help.py') 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) -- cgit 1.4.1