mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #19360: fix test_site when Python is installed into $HOME/.local
This commit is contained in:
commit
dfea31254b
1 changed files with 8 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue