@@ -266,7 +266,7 @@ def _test_subclasser(
266
266
267
267
if isinstance (arg_to_expected_value , SystemExit ):
268
268
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 )
270
270
elif isinstance (arg_to_expected_value , BaseException ):
271
271
expected_exception = arg_to_expected_value .__class__
272
272
expected_error_message = str (arg_to_expected_value ) or None
@@ -471,7 +471,7 @@ def test_subclasser_complex_help_message(class_or_function_: Any):
471
471
(
472
472
"--arg_int 1 --baz X --foo b" ,
473
473
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'?\ )"
475
475
),
476
476
),
477
477
(
@@ -480,7 +480,7 @@ def test_subclasser_complex_help_message(class_or_function_: Any):
480
480
),
481
481
(
482
482
"--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'].""" ),
484
484
),
485
485
],
486
486
)
0 commit comments