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

@ -34,7 +34,7 @@ def setUp(self):
# Note that we're making changes to sys.path
super(BuildExtTestCase, self).setUp()
self.tmp_dir = self.mkdtemp()
self.sys_path = sys.path[:]
self.sys_path = sys.path, sys.path[:]
sys.path.append(self.tmp_dir)
shutil.copy(_get_source_filename(), self.tmp_dir)
if sys.version > "2.6":
@ -89,7 +89,8 @@ def test_build_ext(self):
def tearDown(self):
# Get everything back to normal
test_support.unload('xx')
sys.path = self.sys_path
sys.path = self.sys_path[0]
sys.path[:] = self.sys_path[1]
if sys.version > "2.6":
import site
site.USER_BASE = self.old_user_base