Skip to content

Commit

Permalink
ext
Browse files Browse the repository at this point in the history
  • Loading branch information
xadupre committed Sep 7, 2024
1 parent 27bbc0d commit 1839778
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mlstatpy/ext_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,10 @@ def assertAlmostEqual(
self.assertEqualArray(expected, value, atol=atol, rtol=rtol)

def assertRaise(self, fct: Callable, exc_type: Optional[Exception] = None):
exct = exc_type or Exception
try:
fct()
except exc_type or Exception as e:
except exct as e:
if exc_type is not None and not isinstance(e, exc_type):
raise AssertionError(f"Unexpected exception {type(e)!r}.") # noqa: B904
return
Expand Down

0 comments on commit 1839778

Please sign in to comment.