[Python-checkins] cpython (merge 3.2 -> default): Issue #15300: Ensure the temporary test working directories are in the same

antoine.pitrou python-checkins at python.org
Wed Jul 11 19:23:30 CEST 2012


http://hg.python.org/cpython/rev/4752fafb579d
changeset:   78063:4752fafb579d
parent:      78060:300e2bbd413c
parent:      78062:724a6e0e35f0
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Jul 11 19:21:31 2012 +0200
summary:
  Issue #15300: Ensure the temporary test working directories are in the same parent folder when running tests in multiprocess mode from a Python build.
Patch by Chris Jerdonek.

files:
  Lib/test/regrtest.py |  6 +++++-
  Misc/ACKS            |  1 +
  Misc/NEWS            |  4 ++++
  3 files changed, 10 insertions(+), 1 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -634,10 +634,14 @@
                         output.put((None, None, None, None))
                         return
                     # -E is needed by some tests, e.g. test_import
+                    # Running the child from the same working directory ensures
+                    # that TEMPDIR for the child is the same when
+                    # sysconfig.is_python_build() is true. See issue 15300.
                     popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
                                    stdout=PIPE, stderr=PIPE,
                                    universal_newlines=True,
-                                   close_fds=(os.name != 'nt'))
+                                   close_fds=(os.name != 'nt'),
+                                   cwd=support.SAVEDCWD)
                     stdout, stderr = popen.communicate()
                     retcode = popen.wait()
                     # Strip last refcount output line if it exists, since it
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -505,6 +505,7 @@
 Drew Jenkins
 Flemming Kjær Jensen
 MunSic Jeong
+Chris Jerdonek
 Jim Jewett
 Orjan Johansen
 Fredrik Johansson
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -121,6 +121,10 @@
 Tests
 -----
 
+- Issue #15300: Ensure the temporary test working directories are in the same
+  parent folder when running tests in multiprocess mode from a Python build.
+  Patch by Chris Jerdonek.
+
 - Issue #15284: Skip {send,recv}msg tests in test_socket when IPv6 is not
   enabled. Patch by Brian Brazil.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list