Skip to content

Commit a4c0b2d

Browse files
authored
Merge pull request #157 from brianschubert/gh-156-fix-tests
Fix tests for Python 3.12.8 and 3.13.1.
2 parents ee914c0 + 495d6c3 commit a4c0b2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_to_tap_class.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def _test_subclasser(
266266

267267
if isinstance(arg_to_expected_value, SystemExit):
268268
stderr = _test_raises_system_exit(tap, args_string)
269-
assert str(arg_to_expected_value) in stderr
269+
assert re.search(str(arg_to_expected_value), stderr)
270270
elif isinstance(arg_to_expected_value, BaseException):
271271
expected_exception = arg_to_expected_value.__class__
272272
expected_error_message = str(arg_to_expected_value) or None
@@ -471,7 +471,7 @@ def test_subclasser_complex_help_message(class_or_function_: Any):
471471
(
472472
"--arg_int 1 --baz X --foo b",
473473
SystemExit(
474-
"error: argument {a,b}: invalid choice: 'X' (choose from 'a', 'b')"
474+
r"error: argument \{a,b}: invalid choice: 'X' \(choose from '?a'?, '?b'?\)"
475475
),
476476
),
477477
(
@@ -480,7 +480,7 @@ def test_subclasser_complex_help_message(class_or_function_: Any):
480480
),
481481
(
482482
"--arg_int 1 --foo b --baz A",
483-
SystemExit("""error: argument --baz: Value for variable "baz" must be one of ['X', 'Y', 'Z']."""),
483+
SystemExit(r"""error: argument --baz: Value for variable "baz" must be one of \['X', 'Y', 'Z']."""),
484484
),
485485
],
486486
)

0 commit comments

Comments
 (0)