summaryrefslogtreecommitdiffstats
path: root/Lib/test/__main__.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2013-02-27 17:02:53 (GMT)
committerChris Jerdonek <chris.jerdonek@gmail.com>2013-02-27 17:02:53 (GMT)
commit517e9256143c380d66beebcb142cd656878192ec (patch)
treefc4bf3b67ae734717468ce7717d5cf8471b4f9f3 /Lib/test/__main__.py
parent4cbd293395a5aade6e9c6eeb943ad0072fd6b701 (diff)
downloadcpython-517e9256143c380d66beebcb142cd656878192ec.zip
cpython-517e9256143c380d66beebcb142cd656878192ec.tar.gz
cpython-517e9256143c380d66beebcb142cd656878192ec.tar.bz2
Issue #17283: Share code between __main__.py and regrtest.py in Lib/test.
This commit also removes TESTCWD from regrtest.py's global namespace.
Diffstat (limited to 'Lib/test/__main__.py')
-rw-r--r--Lib/test/__main__.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/Lib/test/__main__.py b/Lib/test/__main__.py
index ce5615b..d5fbe15 100644
--- a/Lib/test/__main__.py
+++ b/Lib/test/__main__.py
@@ -1,13 +1,3 @@
-from test import regrtest, support
+from test import regrtest
-
-TEMPDIR, TESTCWD = regrtest._make_temp_dir_for_build(regrtest.TEMPDIR)
-regrtest.TEMPDIR = TEMPDIR
-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):
- regrtest.main()
+regrtest.main_in_temp_cwd()