diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-23 20:03:22 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-23 20:03:22 (GMT) |
commit | a1782e1be87bc6cffbf5e1b4e74e1b2456d087d4 (patch) | |
tree | 3db596df468fb4baaeb7354d84cc858c493ba508 | |
parent | 09fcb72048be60435ae70ec2c3e23e2325edb421 (diff) | |
download | cpython-a1782e1be87bc6cffbf5e1b4e74e1b2456d087d4.zip cpython-a1782e1be87bc6cffbf5e1b4e74e1b2456d087d4.tar.gz cpython-a1782e1be87bc6cffbf5e1b4e74e1b2456d087d4.tar.bz2 |
Issue #19360: fix test_site when Python is installed into $HOME/.local
-rw-r--r-- | Lib/test/test_site.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 16081a1..db94b7b 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" |