Add --tempdir option for test run (GH-10322)

This commit is contained in:
Steve Dower 2018-11-17 04:14:36 -08:00 committed by GitHub
parent 5a087d5401
commit 38df97a03c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 11 deletions

View file

@ -550,12 +550,12 @@ class Regrtest:
def main(self, tests=None, **kwargs):
global TEMPDIR
self.ns = self.parse_args(kwargs)
if sysconfig.is_python_build():
try:
os.mkdir(TEMPDIR)
except FileExistsError:
pass
if self.ns.tempdir:
TEMPDIR = self.ns.tempdir
os.makedirs(TEMPDIR, exist_ok=True)
# Define a writable temp dir that will be used as cwd while running
# the tests. The name of the dir includes the pid to allow parallel
@ -571,8 +571,6 @@ class Regrtest:
self._main(tests, kwargs)
def _main(self, tests, kwargs):
self.ns = self.parse_args(kwargs)
if self.ns.huntrleaks:
warmup, repetitions, _ = self.ns.huntrleaks
if warmup < 1 or repetitions < 1: