Files
pallectrum/lib/tests/__init__.py

32 lines
615 B
Python
Raw Normal View History

2018-04-01 15:50:24 +02:00
import unittest
import threading
2018-04-01 15:50:24 +02:00
from lib import constants
# some unit tests are modifying globals; sorry.
class SequentialTestCase(unittest.TestCase):
test_lock = threading.Lock()
def setUp(self):
super().setUp()
self.test_lock.acquire()
def tearDown(self):
super().tearDown()
self.test_lock.release()
class TestCaseForTestnet(SequentialTestCase):
2018-04-01 15:50:24 +02:00
@classmethod
def setUpClass(cls):
super().setUpClass()
constants.set_testnet()
@classmethod
def tearDownClass(cls):
super().tearDownClass()
constants.set_mainnet()