mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
Issue #19360: fix test_site when Python is installed into $HOME/.local
This commit is contained in:
parent
09fcb72048
commit
a1782e1be8
1 changed files with 8 additions and 2 deletions
|
|
@ -179,14 +179,20 @@ class HelperFunctionsTests(unittest.TestCase):
|
||||||
rc = subprocess.call([sys.executable, '-s', '-c',
|
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)
|
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 = os.environ.copy()
|
||||||
env["PYTHONNOUSERSITE"] = "1"
|
env["PYTHONNOUSERSITE"] = "1"
|
||||||
rc = subprocess.call([sys.executable, '-c',
|
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)
|
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 = os.environ.copy()
|
||||||
env["PYTHONUSERBASE"] = "/tmp"
|
env["PYTHONUSERBASE"] = "/tmp"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue