def check_bad(self, fromty, toty): with self.assertRaises(TypingError) as raises: dictobject._sentry_safe_cast(fromty, toty) self.assertIn( 'cannot safely cast {fromty} to {toty}'.format(**locals()), str(raises.exception), )
def check_good(self, fromty, toty): dictobject._sentry_safe_cast(fromty, toty)