[Python-checkins] cpython (merge 3.3 -> default): Issue #19360: fix test_site when Python is installed into $HOME/.local

antoine.pitrou python-checkins at python.org
Wed Oct 23 22:04:03 CEST 2013


http://hg.python.org/cpython/rev/61463ff7dc68
changeset:   86594:61463ff7dc68
parent:      86592:b322047fec55
parent:      86593:7f465e154b6d
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Oct 23 22:03:45 2013 +0200
summary:
  Issue #19360: fix test_site when Python is installed into $HOME/.local

files:
  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
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -179,14 +179,20 @@
         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"

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list