]> granicus.if.org Git - python/commitdiff
Merged revisions 72636 via svnmerge from
authorTarek Ziadé <ziade.tarek@gmail.com>
Thu, 14 May 2009 20:17:32 +0000 (20:17 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Thu, 14 May 2009 20:17:32 +0000 (20:17 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72636 | tarek.ziade | 2009-05-14 22:14:13 +0200 (Thu, 14 May 2009) | 1 line

  #6022 fixed test_get_outputs so it doesn't leaves a test file in the cwd
........

Lib/distutils/tests/test_build_ext.py
Misc/NEWS

index cf254ac1c439b1227db5868a586a9c93d90ca215..2bd2292e8ccf8e6dc866c2a11e212ba1988f2844 100644 (file)
@@ -249,12 +249,18 @@ class BuildExtTestCase(support.TempdirManager,
 
         # issue #5977 : distutils build_ext.get_outputs
         # returns wrong result with --inplace
-        cmd.inplace = 1
-        cmd.run()
-        so_file = cmd.get_outputs()[0]
+        other_tmp_dir = os.path.realpath(self.mkdtemp())
+        old_wd = os.getcwd()
+        os.chdir(other_tmp_dir)
+        try:
+            cmd.inplace = 1
+            cmd.run()
+            so_file = cmd.get_outputs()[0]
+        finally:
+            os.chdir(old_wd)
         self.assert_(os.path.exists(so_file))
         so_dir = os.path.dirname(so_file)
-        self.assertEquals(so_dir, os.getcwd())
+        self.assertEquals(so_dir, other_tmp_dir)
 
         cmd.inplace = 0
         cmd.run()
index 373405b9d5d2b00ec7761ab0aa98a5af6ff2764a..8107977d225ec55ac68cc041f7875cfd733c85e7 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -194,6 +194,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #6022: a test file was created in the current working directory by
+  test_get_outputs in Distutils.
+
 - Issue #5977: distutils build_ext.get_outputs was not taking into account the
   inplace option. Initial patch by kxroberto.