Skip to content

Commit 63d00f5

Browse files
committed
One pass
1 parent 2fc1b75 commit 63d00f5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ def unittest_discover():
1111
from pybitmessage import pathmagic
1212
pathmagic.setup()
1313
loader = unittest.defaultTestLoader
14+
# randomize the order of tests in test cases
1415
loader.sortTestMethodsUsing = lambda a, b: random.randint(-1, 1)
1516
# pybitmessage symlink may disappear on Windows
1617
return loader.discover('src.tests')
1718

1819

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

0 commit comments

Comments
 (0)