Save exceptions in the main thread in excQueue
This commit is contained in:
parent
ec922adb36
commit
39853adfb2
|
@ -8,6 +8,7 @@ import pickle # nosec
|
||||||
import Queue
|
import Queue
|
||||||
import random # nosec
|
import random # nosec
|
||||||
import string
|
import string
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
@ -253,4 +254,11 @@ def run():
|
||||||
else:
|
else:
|
||||||
qt_tests = loader.loadTestsFromModule(bitmessageqt.tests)
|
qt_tests = loader.loadTestsFromModule(bitmessageqt.tests)
|
||||||
suite.addTests(qt_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)
|
return unittest.TextTestRunner(verbosity=2).run(suite)
|
||||||
|
|
Reference in New Issue
Block a user