Beispiel #1
0
def test_exception():
    import sys
    sys.path.insert(0, '.')
    import excatch
    excatch.bind()

    def test():
        def cb():
            1 / 0
        cb()
    test()
Beispiel #2
0
 def testUnbind(self):
     excatch.bind()
     excatch.unbind()
     assert excatch.sys.excepthook, excatch.sys.__excepthook__
Beispiel #3
0
 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