# HG changeset patch # User Gregory Szorc # Date 2014-04-20 16:59:01 # Node ID 97475f27bebeb30fedff437a6b7af716f3b8a598 # Parent 1d0aa8bccc8776ddddc48b9e3cac53d6c90434b5 run-tests: move hash seed logic to TestRunner diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1019,6 +1019,11 @@ class TestRunner(object): return self._run(tests) def _run(self, tests): + if 'PYTHONHASHSEED' not in os.environ: + # use a random python hash seed all the time + # we do the randomness ourself to know what seed is used + os.environ['PYTHONHASHSEED'] = str(random.getrandbits(32)) + if self.options.tmpdir: self.options.keep_tmpdir = True tmpdir = self.options.tmpdir @@ -1456,11 +1461,6 @@ def main(args, runner=None, parser=None) return val tests.sort(key=sortkey) - if 'PYTHONHASHSEED' not in os.environ: - # use a random python hash seed all the time - # we do the randomness ourself to know what seed is used - os.environ['PYTHONHASHSEED'] = str(random.getrandbits(32)) - runner.testdir = os.environ['TESTDIR'] = os.getcwd() return runner.run(tests)