summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_site.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-02-05 23:58:18 (GMT)
committerNed Deily <nad@acm.org>2012-02-05 23:58:18 (GMT)
commitd531b295f26d7a0364f171d95b6abac873185a2f (patch)
tree474df3a944f00d433bb3d3d9ba5645129fd54cc6 /Lib/test/test_site.py
parente91e7637bb2d7723b95cd7d3b8f581aff39d70f2 (diff)
downloadcpython-d531b295f26d7a0364f171d95b6abac873185a2f.zip
cpython-d531b295f26d7a0364f171d95b6abac873185a2f.tar.gz
cpython-d531b295f26d7a0364f171d95b6abac873185a2f.tar.bz2
Issue #10881: Fix test_site failure with OS X framework builds.
Diffstat (limited to 'Lib/test/test_site.py')
-rw-r--r--Lib/test/test_site.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 4d36e17..ba42649 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -223,7 +223,19 @@ class HelperFunctionsTests(unittest.TestCase):
self.assertEqual(len(dirs), 1)
wanted = os.path.join('xoxo', 'Lib', 'site-packages')
self.assertEqual(dirs[0], wanted)
+ elif (sys.platform == "darwin" and
+ sysconfig.get_config_var("PYTHONFRAMEWORK")):
+ # OS X framework builds
+ site.PREFIXES = ['Python.framework']
+ dirs = site.getsitepackages()
+ self.assertEqual(len(dirs), 3)
+ wanted = os.path.join('/Library',
+ sysconfig.get_config_var("PYTHONFRAMEWORK"),
+ sys.version[:3],
+ 'site-packages')
+ self.assertEqual(dirs[2], wanted)
elif os.sep == '/':
+ # OS X non-framwework builds, Linux, FreeBSD, etc
self.assertEqual(len(dirs), 2)
wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
'site-packages')
@@ -231,21 +243,12 @@ class HelperFunctionsTests(unittest.TestCase):
wanted = os.path.join('xoxo', 'lib', 'site-python')
self.assertEqual(dirs[1], wanted)
else:
+ # other platforms
self.assertEqual(len(dirs), 2)
self.assertEqual(dirs[0], 'xoxo')
wanted = os.path.join('xoxo', 'lib', 'site-packages')
self.assertEqual(dirs[1], wanted)
- # let's try the specific Apple location
- if (sys.platform == "darwin" and
- sysconfig.get_config_var("PYTHONFRAMEWORK")):
- site.PREFIXES = ['Python.framework']
- dirs = site.getsitepackages()
- self.assertEqual(len(dirs), 3)
- wanted = os.path.join('/Library', 'Python', sys.version[:3],
- 'site-packages')
- self.assertEqual(dirs[2], wanted)
-
class PthFile(object):
"""Helper class for handling testing of .pth files"""