]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 72638 via svnmerge from
authorTarek Ziadé <ziade.tarek@gmail.com>
Thu, 14 May 2009 20:22:00 +0000 (20:22 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Thu, 14 May 2009 20:22:00 +0000 (20:22 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r72638 | tarek.ziade | 2009-05-14 22:20:47 +0200 (Thu, 14 May 2009) | 9 lines

  Merged revisions 72636 via svnmerge from
  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 896dbb57eb6d8808940c481cef7c49c7d093cae9..a3b25aa9bbeca9548bac381e9c973e00e9af953e 100644 (file)
@@ -250,12 +250,18 @@ class BuildExtTestCase(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 ae36caef243e8211c29fd9dda86010df76da040e..13ee03e1d8b2643bb4d4da5d00236cf59b67f54e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -285,6 +285,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.