Skip to content
Myr

Drop `raise_app_exceptions` Client argument. (#238)

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

* Drop `raise_app_exceptions` keyword argument * Improve docstrings for WSGIDispatch and ASGIDispatch * Add docs for fine grained WSGI/ASGI control

authored by Tom Christie · committed by GitHub · parent a960a2a · Browse files · 4 files+36 added−7 removed
This commit

State

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

Diff stats

4 files+36 added−7 removed

  • other:+36 added−7 removed

4 files+36 added−7 removed

modified:docs/advanced.md+15 added
modified:httpx/dispatch/asgi.py+9 added
27 unmodified lines
28 root_path="/submount",29 client=("1.2.3.4", 123)30 )31 client = httpx.Client(dispatch=dispatch)3233 Arguments:3435 * `app` - The ASGI application.36 * `raise_app_exceptions` - Boolean indicating if exceptions in the application37 should be raised. Default to `True`. Can be set to `False` for use cases38 such as testing the content of a client 500 response.39 * `root_path` - The root path on which the ASGI application should be mounted.40 * `client` - A two-tuple indicating the client IP and port of incoming requests.41 ```42 """4344 def __init__(
152 unmodified lines
modified:httpx/dispatch/wsgi.py+10 added
27 unmodified lines
28 script_name="/submount",29 remote_addr="1.2.3.4"30 )31 client = httpx.Client(dispatch=dispatch)323334 Arguments:3536 * `app` - The ASGI application.37 * `raise_app_exceptions` - Boolean indicating if exceptions in the application38 should be raised. Default to `True`. Can be set to `False` for use cases39 such as testing the content of a client 500 response.40 * `script_name` - The root path on which the ASGI application should be mounted.41 * `remote_addr` - A string indicating the client IP of incoming requests.42 ```43 """4445 def __init__(
119 unmodified lines
modified:httpx/client.py+2 added-7 removed
61 unmodified lines
62 max_redirects: int = DEFAULT_MAX_REDIRECTS,63 base_url: URLTypes = None,64 dispatch: typing.Union[AsyncDispatcher, Dispatcher] = None,65 app: typing.Callable = None,66 raise_app_exceptions: bool = True,66 backend: ConcurrencyBackend = None,67 trust_env: bool = None,68 ):69 if backend is None:
4 unmodified lines
74 if app is not None:75 param_count = len(inspect.signature(app).parameters)76 assert param_count in (2, 3)77 if param_count == 2:79 dispatch = WSGIDispatch(80 app=app, raise_app_exceptions=raise_app_exceptions81 )78 dispatch = WSGIDispatch(app=app)79 else:83 dispatch = ASGIDispatch(84 app=app, raise_app_exceptions=raise_app_exceptions85 )80 dispatch = ASGIDispatch(app=app)8182 if dispatch is None:83 async_dispatch: AsyncDispatcher = ConnectionPool(84 verify=verify,
899 unmodified lines