summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_site.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-10-23 20:03:45 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-10-23 20:03:45 (GMT)
commitdfea31254b70582defd11c1772022187cb70c160 (patch)
treeaa8a91de598ab192d239910963b82c8479192c2c /Lib/test/test_site.py
parent9c15ec1ce6a8353b50819baa843c144572807401 (diff)
parenta1782e1be87bc6cffbf5e1b4e74e1b2456d087d4 (diff)
downloadcpython-dfea31254b70582defd11c1772022187cb70c160.zip
cpython-dfea31254b70582defd11c1772022187cb70c160.tar.gz
cpython-dfea31254b70582defd11c1772022187cb70c160.tar.bz2
Issue #19360: fix test_site when Python is installed into $HOME/.local
Diffstat (limited to 'Lib/test/test_site.py')
-rw-r--r--Lib/test/test_site.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 40db067..b0d49e2 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -179,14 +179,20 @@ class HelperFunctionsTests(unittest.TestCase):
rc = subprocess.call([sys.executable, '-s', '-c',
'import sys; sys.exit(%r in sys.path)' % usersite],
env=env)
- self.assertEqual(rc, 0)
+ if usersite == site.getsitepackages()[0]:
+ self.assertEqual(rc, 1)
+ else:
+ self.assertEqual(rc, 0)
env = os.environ.copy()
env["PYTHONNOUSERSITE"] = "1"
rc = subprocess.call([sys.executable, '-c',
'import sys; sys.exit(%r in sys.path)' % usersite],
env=env)
- self.assertEqual(rc, 0)
+ if usersite == site.getsitepackages()[0]:
+ self.assertEqual(rc, 1)
+ else:
+ self.assertEqual(rc, 0)
env = os.environ.copy()
env["PYTHONUSERBASE"] = "/tmp"