Try failing in core tests setUp()

This commit is contained in:
Dmitri Bogomolov 2020-10-26 14:23:19 +02:00
parent 39853adfb2
commit 3251138211
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -57,6 +57,16 @@ def cleanup():
class TestCore(unittest.TestCase):
"""Test case, which runs in main pybitmessage thread"""
def setUp(self):
"""Check exceptions before starting"""
while True:
try:
thread, exc = excQueue.get(block=False)
except Queue.Empty:
return
if thread == 'tests':
self.fail('Exception in the main thread: %s' % exc)
def test_msgcoding(self):
"""test encoding and decoding (originally from helper_msgcoding)"""
msg_data = {