diff --git a/ward/expect.py b/ward/expect.py index 47d3f7ff..8d53cfd4 100644 --- a/ward/expect.py +++ b/ward/expect.py @@ -38,7 +38,7 @@ def __exit__( exc_val: Optional[BaseException], exc_tb: Optional[types.TracebackType], ) -> bool: - if not issubclass(exc_type, self.expected_ex_type): + if exc_type and not issubclass(exc_type, self.expected_ex_type): raise AssertionError( f"Expected exception {self.expected_ex_type}, but {exc_type} was raised instead." )