def test_on_off(self): tracestack.on() self.assertIsNot(sys.excepthook, sys.__excepthook__) self.assertTrue(isinstance(sys.excepthook, tracestack.handler.ExceptionHandler)) tracestack.off() self.assertIs(sys.excepthook, sys.__excepthook__)
def test_on_off(self): tracestack.on() self.assertIsNot(sys.excepthook, sys.__excepthook__) self.assertTrue( isinstance(sys.excepthook, tracestack.handler.ExceptionHandler)) tracestack.off() self.assertIs(sys.excepthook, sys.__excepthook__)
def wrapper(*args, **kwargs): tracestack.on(*handler_args, **handler_kwargs) result = func(*args, **kwargs) tracestack.off() return result