mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Make aggregate tests randomization optional.
This commit is contained in:
parent
f10d970a75
commit
748da1eb58
1 changed files with 4 additions and 1 deletions
|
|
@ -19,9 +19,11 @@
|
|||
|
||||
<Purpose>
|
||||
Run all the unit tests from every .py file beginning with "test_" in 'tuf/tests'.
|
||||
Use --random to run the tests in random order.
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
import glob
|
||||
import random
|
||||
|
|
@ -31,7 +33,8 @@
|
|||
# Remove '.py' from each filename.
|
||||
tests_list = [test[:-3] for test in tests_list]
|
||||
|
||||
random.shuffle(tests_list)
|
||||
if '--random' in sys.argv:
|
||||
random.shuffle(tests_list)
|
||||
|
||||
suite = unittest.TestLoader().loadTestsFromNames(tests_list)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue