Mercurial > hg-stable
changeset 21370:97475f27bebe
run-tests: move hash seed logic to TestRunner
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Apr 2014 09:59:01 -0700 |
parents | 1d0aa8bccc87 |
children | a10ba7870c2d |
files | tests/run-tests.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Sun Apr 20 09:58:26 2014 -0700 +++ b/tests/run-tests.py Sun Apr 20 09:59:01 2014 -0700 @@ -1019,6 +1019,11 @@ 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 @@ 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)