summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_site.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-01-03 17:51:11 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-01-03 17:51:11 (GMT)
commit63ebe1c3093bd40ea5a7e1a225ea0355f13563b4 (patch)
tree2170ebd5b72a9b6988af52597c34b12f729b989d /Lib/test/test_site.py
parent32e1d8340c05fa62ba51dbd942bdc09a21e65f6e (diff)
downloadcpython-63ebe1c3093bd40ea5a7e1a225ea0355f13563b4.zip
cpython-63ebe1c3093bd40ea5a7e1a225ea0355f13563b4.tar.gz
cpython-63ebe1c3093bd40ea5a7e1a225ea0355f13563b4.tar.bz2
Fix test_site for systems without unsetenv. Reported by Zsolt Cserna.
Diffstat (limited to 'Lib/test/test_site.py')
-rw-r--r--Lib/test/test_site.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 9b31a39..8168d7e 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -161,12 +161,16 @@ class HelperFunctionsTests(unittest.TestCase):
usersite = site.USER_SITE
self.assertIn(usersite, sys.path)
+ env = os.environ.copy()
rc = subprocess.call([sys.executable, '-c',
- 'import sys; sys.exit(%r in sys.path)' % usersite])
+ 'import sys; sys.exit(%r in sys.path)' % usersite],
+ env=env)
self.assertEqual(rc, 1)
+ env = os.environ.copy()
rc = subprocess.call([sys.executable, '-s', '-c',
- 'import sys; sys.exit(%r in sys.path)' % usersite])
+ 'import sys; sys.exit(%r in sys.path)' % usersite],
+ env=env)
self.assertEqual(rc, 0)
env = os.environ.copy()