Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def _assert_exception(fun, *args, **kwargs):
fun(*args)
except expected as e:
if matching is not None:
regex = re.compile(matching)
assert regex.match(repr(e)) is None
msg = str(e)
assert re.search(matching, msg), f"Raised exception '{msg}' failed to match with '{matching}'"
except Exception as e:
raise e
else:
Expand Down