summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-12-03 02:03:30 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-12-03 02:03:30 (GMT)
commita7a0e1a0f4248289e00284c115fff54b11f18a53 (patch)
tree31df7fbdd50994ecad32d4c014cf718149fe7585 /Lib/test
parent9efdccae2575ceb70d722677e816926f5080dcc2 (diff)
downloadcpython-a7a0e1a0f4248289e00284c115fff54b11f18a53.zip
cpython-a7a0e1a0f4248289e00284c115fff54b11f18a53.tar.gz
cpython-a7a0e1a0f4248289e00284c115fff54b11f18a53.tar.bz2
Set test.regrtest.TEMPDIR correctly when run with 'python -m test'
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/__main__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/__main__.py b/Lib/test/__main__.py
index 8f12fed..251ac7c 100644
--- a/Lib/test/__main__.py
+++ b/Lib/test/__main__.py
@@ -3,7 +3,7 @@ import sys
import sysconfig
from test import support
-from test.regrtest import main
+from test import regrtest
# findtestdir() gets the dirname out of __file__, so we have to make it
# absolute before changing the working directory.
@@ -22,6 +22,7 @@ if sysconfig.is_python_build():
TEMPDIR = os.path.abspath(TEMPDIR)
if not os.path.exists(TEMPDIR):
os.mkdir(TEMPDIR)
+ regrtest.TEMPDIR = TEMPDIR
# 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
@@ -29,10 +30,11 @@ if sysconfig.is_python_build():
TESTCWD = 'test_python_{}'.format(os.getpid())
TESTCWD = os.path.join(TEMPDIR, TESTCWD)
+regrtest.TESTCWD = TESTCWD
# Run the tests in a context manager that temporary changes the CWD to a
# temporary and writable directory. If it's not possible to create or
# change the CWD, the original CWD will be used. The original CWD is
# available from support.SAVEDCWD.
with support.temp_cwd(TESTCWD, quiet=True):
- main()
+ regrtest.main()