File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,12 @@ def unittest_discover():
11
11
from pybitmessage import pathmagic
12
12
pathmagic .setup ()
13
13
loader = unittest .defaultTestLoader
14
+ # randomize the order of tests in test cases
14
15
loader .sortTestMethodsUsing = lambda a , b : random .randint (- 1 , 1 )
15
16
# pybitmessage symlink may disappear on Windows
16
17
return loader .discover ('src.tests' )
17
18
18
19
19
20
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 ())
You can’t perform that action at this time.
0 commit comments