Пример #1
0
	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__)
Пример #2
0
 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__)
Пример #3
0
 def wrapper(*args, **kwargs):
     tracestack.on(*handler_args, **handler_kwargs)
     result = func(*args, **kwargs)
     tracestack.off()
     return result
Пример #4
0
 def wrapper(*args, **kwargs):
     tracestack.on(*handler_args, **handler_kwargs)
     result = func(*args, **kwargs)
     tracestack.off()
     return result