aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_packageindex.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/tests/test_packageindex.py')
-rw-r--r--setuptools/tests/test_packageindex.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 3e446b54..1060e787 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -46,18 +46,14 @@ class TestPackageIndex(unittest.TestCase):
import httplib
raise httplib.BadStatusLine('line')
- old_urlopen = urllib2.urlopen
- urllib2.urlopen = _urlopen
+ index.opener = _urlopen
url = 'http://example.com'
try:
- try:
- v = index.open_url(url)
- except Exception, v:
- self.assertTrue('line' in str(v))
- else:
- raise AssertionError('Should have raise here!')
- finally:
- urllib2.urlopen = old_urlopen
+ v = index.open_url(url)
+ except Exception, v:
+ self.assertTrue('line' in str(v))
+ else:
+ raise AssertionError('Should have raise here!')
def test_bad_url_double_scheme(self):
"""
@@ -101,7 +97,7 @@ class TestPackageIndex(unittest.TestCase):
"""
Download links from the pypi simple index should be used before
external download links.
- http://bitbucket.org/tarek/distribute/issue/163/md5-validation-error
+ https://bitbucket.org/tarek/distribute/issue/163
Usecase :
- someone uploads a package on pypi, a md5 is generated
@@ -110,7 +106,7 @@ class TestPackageIndex(unittest.TestCase):
- someone reuploads the package (with a different md5)
- while easy_installing, an MD5 error occurs because the external link
is used
- -> Distribute should use the link from pypi, not the external one.
+ -> Setuptools should use the link from pypi, not the external one.
"""
if sys.platform.startswith('java'):
# Skip this test on jython because binding to :0 fails