diff --git a/src/tests/core.py b/src/tests/core.py index 6ed46ad9..90dd656c 100644 --- a/src/tests/core.py +++ b/src/tests/core.py @@ -8,6 +8,7 @@ import pickle # nosec import Queue import random # nosec import string +import sys import time import unittest @@ -253,4 +254,11 @@ def run(): else: qt_tests = loader.loadTestsFromModule(bitmessageqt.tests) suite.addTests(qt_tests) + + def keep_exc(_, exc, *args): + """Own exception hook for test cases""" + excQueue.put(('tests', exc)) + + sys.excepthook = keep_exc + return unittest.TextTestRunner(verbosity=2).run(suite)