I think you can do ``with self.assertRaises(verify.InvalidReceipt) as err``