Skip to content
Myr

Make HTTPError importable from the top-level (#421)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Josep Cugat · committed by Seth Michael Larson · parent db3e3a0 · Browse files · 3 files+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−2 removed

  • tests:+2 added−2 removed
  • other:+2 added−0 removed

3 files+4 added−2 removed

modified:httpx/__init__.py+2 added
25 unmodified lines
26from .exceptions import (27 ConnectTimeout,28 CookieConflict,29 DecodingError,30 HTTPError,31 InvalidURL,32 NotRedirectResponse,33 PoolTimeout,34 ProtocolError,
62 unmodified lines
97 "HTTPProxyMode",98 "ConnectTimeout",99 "CookieConflict",100 "DecodingError",101 "HTTPError",102 "InvalidURL",103 "NotRedirectResponse",104 "PoolTimeout",105 "ProtocolError",
40 unmodified lines
modified:tests/client/test_async_client.py+1 added-1 removed
93 unmodified lines
94 "GET", server.url.copy_with(path=f"/status/{status_code}")95 )9697 if 400 <= status_code < 600:98 with pytest.raises(httpx.exceptions.HTTPError) as exc_info:98 with pytest.raises(httpx.HTTPError) as exc_info:99 response.raise_for_status()100 assert exc_info.value.response == response101 else:102 assert response.raise_for_status() is None
46 unmodified lines
modified:tests/client/test_client.py+1 added-1 removed
86 unmodified lines
87 response = client.request(88 "GET", server.url.copy_with(path="/status/{}".format(status_code))89 )90 if 400 <= status_code < 600:91 with pytest.raises(httpx.exceptions.HTTPError) as exc_info:91 with pytest.raises(httpx.HTTPError) as exc_info:92 response.raise_for_status()93 assert exc_info.value.response == response94 else:95 assert response.raise_for_status() is None
81 unmodified lines