Kaydet (Commit) a1782e1b authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Issue #19360: fix test_site when Python is installed into $HOME/.local

üst 09fcb720
......@@ -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"
......
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