Force urllib3 to raise errors immediately

Otherwise it raises the MaxRetryError, masking the real one.
This commit is contained in:
Chris Dent 2016-03-18 15:57:03 +00:00
parent 84d1d4c822
commit 0bd6442647
2 changed files with 4 additions and 4 deletions

View File

@ -211,8 +211,8 @@ def test_urllib3_in_out():
assert 'WSGI intercept successful!' in str(response.data)
# outside the context manager the intercept does not work
with py.test.raises(urllib3.exceptions.MaxRetryError):
httppool.request('GET', url)
with py.test.raises(urllib3.exceptions.ProtocolError):
httppool.request('GET', url, retries=False)
# urllib

View File

@ -38,8 +38,8 @@ def test_http_other_port():
def test_bogus_domain():
with InstalledApp(wsgi_app.simple_app, host=HOST, port=80):
py.test.raises(
urllib3.exceptions.MaxRetryError,
'http.request("GET", "http://_nonexistant_domain_")')
urllib3.exceptions.ProtocolError,
'http.request("GET", "http://_nonexistant_domain_", retries=False)')
def test_proxy_handling():