def test_trait_exception_handler_can_access_exception(self): """ Tests if trait exception handlers can access the traceback of the exception. """ from traits import trait_notifiers def _handle_exception(obj, name, old, new): self.assertIsNotNone(sys.exc_info()[0]) ge = GenerateFailingEvents() try: trait_notifiers.push_exception_handler( _handle_exception, reraise_exceptions=False, main=True ) ge.trait_set(name="John Cleese") finally: trait_notifiers.pop_exception_handler()
def test_trait_exception_handler_can_access_exception(self): """ Tests if trait exception handlers can access the traceback of the exception. """ import traceback from traits import trait_notifiers def _handle_exception(obj,name,old,new): self.assertIsNotNone(sys.exc_info()[0]) ge = GenerateFailingEvents() try: trait_notifiers.push_exception_handler( _handle_exception, reraise_exceptions=False, main=True ) ge.trait_set(name='John Cleese') finally: trait_notifiers.pop_exception_handler()
def tearDown(self): trait_notifiers.pop_exception_handler()
def tearDown(self): pop_exception_handler() GuiTestAssistant.tearDown(self)