Skip to content

Commit

Permalink
One pass
Browse files Browse the repository at this point in the history
  • Loading branch information
g1itch committed Feb 17, 2021
1 parent 2fc1b75 commit 63d00f5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ def unittest_discover():
from pybitmessage import pathmagic
pathmagic.setup()
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
return loader.discover('src.tests')


if __name__ == "__main__":
runner = unittest.TextTestRunner(verbosity=2)
# Two passes with random order
if not runner.run(unittest_discover()).wasSuccessful():
sys.exit('Tests failed on first pass!')
sys.exit(not runner.run(unittest_discover()).wasSuccessful())
result = unittest.TextTestRunner(verbosity=2).run(unittest_discover())
sys.exit(not result.wasSuccessful())

0 comments on commit 63d00f5

Please sign in to comment.