diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-05-14 20:14:13 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-05-14 20:14:13 (GMT) |
commit | cbb4f9ef58ec7673f7c64b16496879b914b0972a (patch) | |
tree | a0bfe1e3ee37467ae0b14b92560c502b3306d3fd /Lib/distutils/tests | |
parent | 878555401e28a6da0ce05d2de637058a20ea7504 (diff) | |
download | cpython-cbb4f9ef58ec7673f7c64b16496879b914b0972a.zip cpython-cbb4f9ef58ec7673f7c64b16496879b914b0972a.tar.gz cpython-cbb4f9ef58ec7673f7c64b16496879b914b0972a.tar.bz2 |
#6022 fixed test_get_outputs so it doesn't leaves a test file in the cwd
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r-- | Lib/distutils/tests/test_build_ext.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 45c5b39..c6533ca 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -312,12 +312,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() |