mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-110164: regrtest disables random if SOURCE_DATE_EPOCH (#110168)
If the SOURCE_DATE_EPOCH environment variable is defined, regrtest now disables randomization of tests.
This commit is contained in:
parent
adf0f15a06
commit
65c285062c
3 changed files with 17 additions and 2 deletions
|
@ -148,6 +148,14 @@ class ParseArgsTestCase(unittest.TestCase):
|
|||
ns = self.parse_args([opt])
|
||||
self.assertTrue(ns.randomize)
|
||||
|
||||
with os_helper.EnvironmentVarGuard() as env:
|
||||
env['SOURCE_DATE_EPOCH'] = '1'
|
||||
|
||||
ns = self.parse_args(['--randomize'])
|
||||
regrtest = main.Regrtest(ns)
|
||||
self.assertFalse(regrtest.randomize)
|
||||
self.assertIsNone(regrtest.random_seed)
|
||||
|
||||
def test_randseed(self):
|
||||
ns = self.parse_args(['--randseed', '12345'])
|
||||
self.assertEqual(ns.random_seed, 12345)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue