Skip to content

Commit 1839778

Browse files
committed
ext
1 parent 27bbc0d commit 1839778

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlstatpy/ext_test_case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,10 @@ def assertAlmostEqual(
385385
self.assertEqualArray(expected, value, atol=atol, rtol=rtol)
386386

387387
def assertRaise(self, fct: Callable, exc_type: Optional[Exception] = None):
388+
exct = exc_type or Exception
388389
try:
389390
fct()
390-
except exc_type or Exception as e:
391+
except exct as e:
391392
if exc_type is not None and not isinstance(e, exc_type):
392393
raise AssertionError(f"Unexpected exception {type(e)!r}.") # noqa: B904
393394
return

0 commit comments

Comments
 (0)