diff options
Diffstat (limited to 'Lib/distutils/tests/test_sysconfig.py')
-rw-r--r-- | Lib/distutils/tests/test_sysconfig.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py index eb36204..edc755e 100644 --- a/Lib/distutils/tests/test_sysconfig.py +++ b/Lib/distutils/tests/test_sysconfig.py @@ -17,8 +17,15 @@ 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): + if os.path.isfile(TESTFN): + os.remove(TESTFN) + elif os.path.isdir(TESTFN): + shutil.rmtree(TESTFN) + 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 +58,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: |