as e:

and then outside the block self.assertIs(e.exception.cause, cause)