def test_exception(): import sys sys.path.insert(0, '.') import excatch excatch.bind() def test(): def cb(): 1 / 0 cb() test()
def testUnbind(self): excatch.bind() excatch.unbind() assert excatch.sys.excepthook, excatch.sys.__excepthook__
def testBind(self): old = excatch.Hook.custom_hook excatch.Hook.custom_hook = 'TEST' excatch.bind() assert excatch.sys.excepthook, 'TEST' excatch.Hook.custom_hook = old