summaryrefslogtreecommitdiff
path: root/Lib/test/test_site.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-01 13:10:12 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-01 13:10:12 +0200
commit9a3a7d1676e3e162e2213ddf62c925e8d9b724af (patch)
treec934e04d1f64ced2268ce81c3618e3f416a3ce74 /Lib/test/test_site.py
parentcff8685224e9c1d0024aecfb87a2c120ca3a5542 (diff)
parentab27b2a1ce268e24b44ea0e63ccff6b96e4f710e (diff)
downloadcpython-9a3a7d1676e3e162e2213ddf62c925e8d9b724af.tar.gz
Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails.
Original patch by Martin Panter.
Diffstat (limited to 'Lib/test/test_site.py')
-rw-r--r--Lib/test/test_site.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 83252227ec..79af49cb09 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -147,7 +147,7 @@ class HelperFunctionsTests(unittest.TestCase):
re.escape(os.path.join(pth_dir, pth_fn)))
# XXX: ditto previous XXX comment.
self.assertRegex(err_out.getvalue(), 'Traceback')
- self.assertRegex(err_out.getvalue(), 'TypeError')
+ self.assertRegex(err_out.getvalue(), 'ValueError')
def test_addsitedir(self):
# Same tests for test_addpackage since addsitedir() essentially just
@@ -235,20 +235,18 @@ class HelperFunctionsTests(unittest.TestCase):
# OS X framework builds
site.PREFIXES = ['Python.framework']
dirs = site.getsitepackages()
- self.assertEqual(len(dirs), 3)
+ self.assertEqual(len(dirs), 2)
wanted = os.path.join('/Library',
sysconfig.get_config_var("PYTHONFRAMEWORK"),
sys.version[:3],
'site-packages')
- self.assertEqual(dirs[2], wanted)
+ self.assertEqual(dirs[1], wanted)
elif os.sep == '/':
# OS X non-framwework builds, Linux, FreeBSD, etc
- self.assertEqual(len(dirs), 2)
+ self.assertEqual(len(dirs), 1)
wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
'site-packages')
self.assertEqual(dirs[0], wanted)
- wanted = os.path.join('xoxo', 'lib', 'site-python')
- self.assertEqual(dirs[1], wanted)
else:
# other platforms
self.assertEqual(len(dirs), 2)