diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py index 3b7897b8a88a45..32ce04b0f90cfe 100644 --- a/Lib/test/test_bz2.py +++ b/Lib/test/test_bz2.py @@ -72,7 +72,9 @@ class BaseTest(unittest.TestCase): # simply use the bigger test data for all tests. test_size = 0 BIG_TEXT = bytearray(128*1024) - for fname in glob.glob(os.path.join(glob.escape(os.path.dirname(__file__)), '*.py')): + _files = sorted(glob.glob(os.path.join(glob.escape(os.path.dirname(__file__)), '*.py'))) + random.Random(555).shuffle(_files) + for fname in _files: with open(fname, 'rb') as fh: test_size += fh.readinto(memoryview(BIG_TEXT)[test_size:]) if test_size > 128*1024: