From: Tarek Ziadé Date: Thu, 14 May 2009 20:20:47 +0000 (+0000) Subject: Merged revisions 72636 via svnmerge from X-Git-Tag: v3.1rc1~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4210c6edcaf85ca2675c436a0992ab6e96f3d165;p=python 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 ........ --- diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 64ca6505c1..6a463c0117 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -312,12 +312,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() diff --git a/Misc/NEWS b/Misc/NEWS index d8ba4c54f0..b80f7b3e26 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -607,6 +607,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.