mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Changed distutils tests to avoid environment alteration
This commit is contained in:
parent
11abfe640f
commit
2b06d42db5
13 changed files with 67 additions and 34 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue