about summary refs log tree commit diff
path: root/tst/test_help.py
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2025-06-18 16:29:13 +0900
committerNguyễn Gia Phong <cnx@loang.net>2025-06-18 16:29:13 +0900
commit2ad9177830e41802b673d1fe513bca883c5e496b (patch)
tree10c364208340ae5404b46e06efe932e3649735f9 /tst/test_help.py
parent63f17a58145b827a56c4963ad306157cf2dff887 (diff)
downloadscadere-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.py8
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)