]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Make HTTPError importable from the top-level (#421)
authorJosep Cugat <jcugat@gmail.com>
Tue, 1 Oct 2019 18:37:05 +0000 (20:37 +0200)
committerSeth Michael Larson <sethmichaellarson@gmail.com>
Tue, 1 Oct 2019 18:37:05 +0000 (13:37 -0500)
httpx/__init__.py
tests/client/test_async_client.py
tests/client/test_client.py

index b464daa95dadce2aa1fc127d036dfdcdc8f8e619..6859964f8aca3d0017bb3bc1426ef4566490b30b 100644 (file)
@@ -27,6 +27,7 @@ from .exceptions import (
     ConnectTimeout,
     CookieConflict,
     DecodingError,
+    HTTPError,
     InvalidURL,
     NotRedirectResponse,
     PoolTimeout,
@@ -97,6 +98,7 @@ __all__ = [
     "ConnectTimeout",
     "CookieConflict",
     "DecodingError",
+    "HTTPError",
     "InvalidURL",
     "NotRedirectResponse",
     "PoolTimeout",
index 37f0390f7aa9f7226b15b81dfb43bbfa468cd9a1..eaac5ef76a00d25b2f0bc55e5f436598949d69b6 100644 (file)
@@ -95,7 +95,7 @@ async def test_raise_for_status(server, backend):
             )
 
             if 400 <= status_code < 600:
-                with pytest.raises(httpx.exceptions.HTTPError) as exc_info:
+                with pytest.raises(httpx.HTTPError) as exc_info:
                     response.raise_for_status()
                 assert exc_info.value.response == response
             else:
index 9183692198bb824e1850ce2e3bcf4e78c8e4abc5..4cca746db6a74dd69f3587cf2e805487600c25e0 100644 (file)
@@ -88,7 +88,7 @@ def test_raise_for_status(server):
                 "GET", server.url.copy_with(path="/status/{}".format(status_code))
             )
             if 400 <= status_code < 600:
-                with pytest.raises(httpx.exceptions.HTTPError) as exc_info:
+                with pytest.raises(httpx.HTTPError) as exc_info:
                     response.raise_for_status()
                 assert exc_info.value.response == response
             else: