diff --git a/microtest.py b/microtest.py index a2538ce..1a77c3f 100644 --- a/microtest.py +++ b/microtest.py @@ -50,8 +50,8 @@ async def to_throw(self, exception = Exception): try: await self.value() - except exception: - threw_expected = True + except Exception as caught_exception: + threw_expected = exception.__name__ == type(caught_exception).__name__ pass if self._fails(not threw_expected):