Commit 8ac95ee6 authored by Brett Cannon's avatar Brett Cannon

Fix test_site from modifying sysconfig._CONFIG_VARS.

parent 5ceef131
...@@ -39,6 +39,7 @@ class HelperFunctionsTests(unittest.TestCase): ...@@ -39,6 +39,7 @@ class HelperFunctionsTests(unittest.TestCase):
self.old_base = site.USER_BASE self.old_base = site.USER_BASE
self.old_site = site.USER_SITE self.old_site = site.USER_SITE
self.old_prefixes = site.PREFIXES self.old_prefixes = site.PREFIXES
self.original_vars = sysconfig._CONFIG_VARS
self.old_vars = copy(sysconfig._CONFIG_VARS) self.old_vars = copy(sysconfig._CONFIG_VARS)
def tearDown(self): def tearDown(self):
...@@ -47,7 +48,9 @@ class HelperFunctionsTests(unittest.TestCase): ...@@ -47,7 +48,9 @@ class HelperFunctionsTests(unittest.TestCase):
site.USER_BASE = self.old_base site.USER_BASE = self.old_base
site.USER_SITE = self.old_site site.USER_SITE = self.old_site
site.PREFIXES = self.old_prefixes site.PREFIXES = self.old_prefixes
sysconfig._CONFIG_VARS = self.old_vars sysconfig._CONFIG_VARS = self.original_vars
sysconfig._CONFIG_VARS.clear()
sysconfig._CONFIG_VARS.update(self.old_vars)
def test_makepath(self): def test_makepath(self):
# Test makepath() have an absolute path for its first return value # Test makepath() have an absolute path for its first return value
......
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