Skip to content

fix(test): Fixes for "TestClient" changes (FastAPI 0.109 / Starlette)

Mario Oenning requested to merge moson/aurweb:fastapi-0.109-update into master

Seems that client is optional according to the ASGI spec.
https://asgi.readthedocs.io/en/latest/specs/www.html

With Starlette 0.35 the TestClient connection scope is None for client.
https://github.com/encode/starlette/pull/2377


I'm wondering if there is a better way of doing this though.
In theory request.client could be None, but in practice this does not seem to happen (otherwise we'd already run into issues) 🤔
So these changes basically just address the changes that were made to Starlette's TestClient.

Merge request reports

Loading