Commits

Ronny Pfannschmidt committed 1014a21

ensure that the conftest excepthook wont fail

Comments (0)

Files changed (1)

 
 def pytest_runtest_call(item, __multicall__):
     sys.excepthook = Hook(sys.excepthook)
-    __multicall__.execute()
-    hook = sys.excepthook
-    sys.excepthook = hook.oldhook
-    if hook.called:
-        tp, val, tb = hook.args
-        print repr(tp), repr(val), repr(tb)
-        raise tp, val, tb
+    try:
+        __multicall__.execute()
+    finally:
+        hook = sys.excepthook
+        sys.excepthook = hook.oldhook
+        if hook.called:
+            tp, val, tb = hook.args
+            print repr(tp), repr(val), repr(tb)
+            raise tp, val, tb