Force urllib3 to raise errors immediately
Otherwise it raises the MaxRetryError, masking the real one.
This commit is contained in:
parent
84d1d4c822
commit
0bd6442647
|
@ -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
|
||||
|
|
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue