def get_pickleable_exception(exc): """Make sure exception is pickleable.""" try: pickle.dumps(deepcopy(exc)) except Exception: return UnpickleableExceptionWrapper.from_exception(exc) return exc
def test_init(self): x = UnpickleableExceptionWrapper('foo', 'Bar', [10, lambda x: x]) assert x.exc_args assert len(x.exc_args) == 2
def test_init(self): x = UnpickleableExceptionWrapper('foo', 'Bar', [10, lambda x: x]) self.assertTrue(x.exc_args) self.assertEqual(len(x.exc_args), 2)