file reorganization with top-level module
This commit is contained in:
38
electrum/tests/__init__.py
Normal file
38
electrum/tests/__init__.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import unittest
|
||||
import threading
|
||||
|
||||
from electrum import constants
|
||||
|
||||
|
||||
# Set this locally to make the test suite run faster.
|
||||
# If set, unit tests that would normally test functions with multiple implementations,
|
||||
# will only be run once, using the fastest implementation.
|
||||
# e.g. libsecp256k1 vs python-ecdsa. pycryptodomex vs pyaes.
|
||||
FAST_TESTS = False
|
||||
|
||||
|
||||
# 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):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
constants.set_testnet()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
super().tearDownClass()
|
||||
constants.set_mainnet()
|
||||
Reference in New Issue
Block a user