File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ def func(a, b=1):
91
91
group = excinfo .value
92
92
assert len (group .exceptions ) == 1 , f"Found { len (group .exceptions )} exceptions"
93
93
exc = group .exceptions [0 ]
94
+ assert isinstance (
95
+ exc , error
96
+ ), f"Unexpected exception type: { type (exc )} , expected { error } "
94
97
if not re .search (message , str (exc )):
95
98
raise AssertionError (f"exception { exc !r} did not match pattern { message !r} " )
96
99
@@ -233,5 +236,8 @@ def func(a, b):
233
236
group = excinfo .value
234
237
assert len (group .exceptions ) == 1 , f"Found { len (group .exceptions )} exceptions"
235
238
exc = group .exceptions [0 ]
239
+ assert isinstance (
240
+ exc , error
241
+ ), f"Unexpected exception type: { type (exc )} , expected { error } "
236
242
if not re .search (message , str (exc )):
237
243
raise AssertionError (f"exception { exc !r} did not match pattern { message !r} " )
You can’t perform that action at this time.
0 commit comments