Skip to content

Commit

Permalink
Merge pull request #157 from brianschubert/gh-156-fix-tests
Browse files Browse the repository at this point in the history
Fix tests for Python 3.12.8 and 3.13.1.
  • Loading branch information
martinjm97 authored Dec 8, 2024
2 parents ee914c0 + 495d6c3 commit a4c0b2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_to_tap_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _test_subclasser(

if isinstance(arg_to_expected_value, SystemExit):
stderr = _test_raises_system_exit(tap, args_string)
assert str(arg_to_expected_value) in stderr
assert re.search(str(arg_to_expected_value), stderr)
elif isinstance(arg_to_expected_value, BaseException):
expected_exception = arg_to_expected_value.__class__
expected_error_message = str(arg_to_expected_value) or None
Expand Down Expand Up @@ -471,7 +471,7 @@ def test_subclasser_complex_help_message(class_or_function_: Any):
(
"--arg_int 1 --baz X --foo b",
SystemExit(
"error: argument {a,b}: invalid choice: 'X' (choose from 'a', 'b')"
r"error: argument \{a,b}: invalid choice: 'X' \(choose from '?a'?, '?b'?\)"
),
),
(
Expand All @@ -480,7 +480,7 @@ def test_subclasser_complex_help_message(class_or_function_: Any):
),
(
"--arg_int 1 --foo b --baz A",
SystemExit("""error: argument --baz: Value for variable "baz" must be one of ['X', 'Y', 'Z']."""),
SystemExit(r"""error: argument --baz: Value for variable "baz" must be one of \['X', 'Y', 'Z']."""),
),
],
)
Expand Down

0 comments on commit a4c0b2d

Please sign in to comment.