Commit 904218f8 authored by Tarek Ziadé's avatar Tarek Ziadé

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

parent 6d9fe7ee
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment