summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_site.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2010-01-29 11:41:03 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2010-01-29 11:41:03 (GMT)
commitedacea30e457e151611a9fe560120cedb3bdc527 (patch)
tree3227e5e1c060cce48b00d34b9ae46571f079e2fb /Lib/test/test_site.py
parent82b83985832a0b1922aa86261f764b12a7237ac5 (diff)
downloadcpython-edacea30e457e151611a9fe560120cedb3bdc527.zip
cpython-edacea30e457e151611a9fe560120cedb3bdc527.tar.gz
cpython-edacea30e457e151611a9fe560120cedb3bdc527.tar.bz2
Merged revisions 77704,77752 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77704 | tarek.ziade | 2010-01-23 10:23:15 +0100 (Sat, 23 Jan 2010) | 1 line taking sysconfig out of distutils ........ r77752 | tarek.ziade | 2010-01-26 00:19:56 +0100 (Tue, 26 Jan 2010) | 1 line switched the call order so this call works without suffering from issue #7774 ........
Diffstat (limited to 'Lib/test/test_site.py')
-rw-r--r--Lib/test/test_site.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 0fde46a..931a166 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -11,6 +11,9 @@ import os
import sys
import encodings
import subprocess
+import sysconfig
+from copy import copy
+
# Need to make sure to not import 'site' if someone specified ``-S`` at the
# command-line. Detect this by just making sure 'site' has not been imported
# already.
@@ -38,6 +41,7 @@ class HelperFunctionsTests(unittest.TestCase):
self.old_base = site.USER_BASE
self.old_site = site.USER_SITE
self.old_prefixes = site.PREFIXES
+ self.old_vars = copy(sysconfig._CONFIG_VARS)
def tearDown(self):
"""Restore sys.path"""
@@ -45,6 +49,7 @@ class HelperFunctionsTests(unittest.TestCase):
site.USER_BASE = self.old_base
site.USER_SITE = self.old_site
site.PREFIXES = self.old_prefixes
+ sysconfig._CONFIG_VARS = self.old_vars
def test_makepath(self):
# Test makepath() have an absolute path for its first return value
@@ -137,6 +142,9 @@ class HelperFunctionsTests(unittest.TestCase):
# let's set PYTHONUSERBASE and see if it uses it
site.USER_BASE = None
+ import sysconfig
+ sysconfig._CONFIG_VARS = None
+
with EnvironmentVarGuard() as environ:
environ['PYTHONUSERBASE'] = 'xoxo'
self.assertTrue(site.getuserbase().startswith('xoxo'),