Changed distutils tests to avoid environment alteration

This commit is contained in:
Tarek Ziadé 2009-10-18 09:28:26 +00:00
parent 11abfe640f
commit 2b06d42db5
13 changed files with 67 additions and 34 deletions

View file

@ -17,8 +17,16 @@ class SysconfigTestCase(support.EnvironGuard,
def tearDown(self):
if self.makefile is not None:
os.unlink(self.makefile)
self.cleanup_testfn()
super(SysconfigTestCase, self).tearDown()
def cleanup_testfn(self):
path = test.test_support.TESTFN
if os.path.isfile(path):
os.remove(path)
elif os.path.isdir(path):
shutil.rmtree(path)
def test_get_config_h_filename(self):
config_h = sysconfig.get_config_h_filename()
self.assertTrue(os.path.isfile(config_h), config_h)
@ -51,8 +59,8 @@ class SysconfigTestCase(support.EnvironGuard,
if get_default_compiler() != 'unix':
return
self.environ['AR'] = 'my_ar'
self.environ['ARFLAGS'] = '-arflags'
os.environ['AR'] = 'my_ar'
os.environ['ARFLAGS'] = '-arflags'
# make sure AR gets caught
class compiler: