aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2012-07-22 16:27:20 -0400
committerJason R. Coombs <jaraco@jaraco.com>2012-07-22 16:27:20 -0400
commit3cb3df324a301b4ad382d8be022442c62e65c770 (patch)
tree83775af57c4bfe89a1a5e6f0b9ac8a15c8fbe5dc
parent0cb6b8bebf4f16d9187827d843f5cdd908067b09 (diff)
parent6ee14089b193c7e179fc2a0472644f5684d8bef4 (diff)
downloadexternal_python_setuptools-3cb3df324a301b4ad382d8be022442c62e65c770.tar.gz
external_python_setuptools-3cb3df324a301b4ad382d8be022442c62e65c770.tar.bz2
external_python_setuptools-3cb3df324a301b4ad382d8be022442c62e65c770.zip
Merge
--HG-- branch : distribute extra : rebase_source : c4ea7aaf7256ffbb49843e9610515a08a76daa63
-rw-r--r--setuptools/tests/test_packageindex.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 776382d0..107a57b6 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -60,6 +60,9 @@ class TestPackageIndex(unittest.TestCase):
urllib2.urlopen = old_urlopen
def test_bad_url_double_scheme(self):
+ """
+ A bad URL with a double scheme should raise a DistutilsError.
+ """
index = setuptools.package_index.PackageIndex(
hosts=('www.example.com',)
)
@@ -69,13 +72,9 @@ class TestPackageIndex(unittest.TestCase):
try:
index.open_url(url)
except distutils.errors.DistutilsError, error:
- # Python 2.7.3
- self.assertTrue('getaddrinfo failed' in str(error), "error was " +
- str(error))
- except httplib.InvalidURL, error:
- # Python 2.7.2 and earlier
- self.assertTrue('nonnumeric port' in str(error), "error was " +
- str(error))
+ msg = unicode(error)
+ assert 'nonnumeric port' in msg or 'getaddrinfo failed' in msg
+ raise RuntimeError("Did not raise")
def test_bad_url_screwy_href(self):
index = setuptools.package_index.PackageIndex(