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