Rewrite tests script for using the pybitmessage package, not src

This commit is contained in:
Dmitri Bogomolov 2021-11-17 20:11:12 +02:00
parent 0560342201
commit a6c81b5a4a
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -13,9 +13,9 @@ def unittest_discover():
loader = unittest.defaultTestLoader
# randomize the order of tests in test cases
loader.sortTestMethodsUsing = lambda a, b: random.randint(-1, 1)
# pybitmessage symlink may disappear on Windows
testsuite = loader.discover('src.tests')
testsuite.addTests([loader.discover('src.pyelliptic')])
# pybitmessage symlink disappears on Windows!
testsuite = loader.discover('pybitmessage.tests')
testsuite.addTests([loader.discover('pybitmessage.pyelliptic')])
return testsuite
@ -24,10 +24,9 @@ if __name__ == "__main__":
success = unittest.TextTestRunner(verbosity=2).run(
unittest_discover()).wasSuccessful()
try:
from src.tests import common
from pybitmessage.tests import common
except ImportError:
checkup = False
print('ImportError from src.tests')
else:
checkup = common.checkup()