diff options
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) |