Skip to content

Commit

Permalink
Fix tests on Python 3.12.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Dec 6, 2024
1 parent 67cc9ad commit 09f349e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions tests/fixtures/help-3.12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
usage: obsah [-h] action ...

positional arguments:
action which action to execute
dummy Short description
multiple_plays
positional positional argument test
repoclosure
setup

options:
-h, --help show this help message and exit
6 changes: 5 additions & 1 deletion tests/test_obsah.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ def test_generate_ansible_args(playbooks_path, parser, cliargs, expected):


def test_obsah_argument_parser_help(fixture_dir, parser):
path = fixture_dir / 'help.txt'
# https://github.com/python/cpython/commit/7cc773ba3d07d4a2e6cd39063fd1954abd6ae8f1
if sys.version_info >= (3, 12, 7):
path = fixture_dir / 'help-3.12.txt'
else:
path = fixture_dir / 'help.txt'
expected = path.read()
if sys.version_info >= (3, 10, 0):
expected = expected.replace('optional arguments:', 'options:')
Expand Down

0 comments on commit 09f349e

Please sign in to comment.