First Check
Commit to Help
Example Code
from fastapi.testclient import TestClient
TestClient(app, headers={...})
Description
FastAPI re-exports starlette TestClient which seems to be an httpx.Client connected to the asgi app under test.
starlette has recently fixed the TestClient.__init__ to follow httpx.Client.__init__ so that the earlier accepts headers=... kwarg, just like the latter.
Kludex/starlette#1966
starlette has made a release 0.23.0, but the latest FastAPI pins a specific version starlette==0.22.0
Thus, as a dev, I can't use the latest "features" or more like reasonable expectations for the TestClient.
A newcomer would read the docs / source code and would expect TestClient to accept headers kwarg and get confused why that's rejected.
Thus, the question: is there a reason to pin a specific version of starlette?
Operating System
Other
Operating System Details
An issue with any OS.
FastAPI Version
0.88.0
Python Version
3.10, etc.
Additional Context
No response
First Check
Commit to Help
Example Code
Description
FastAPI re-exports starlette
TestClientwhich seems to be anhttpx.Clientconnected to the asgi app under test.starlette has recently fixed the
TestClient.__init__to followhttpx.Client.__init__so that the earlier acceptsheaders=...kwarg, just like the latter.Kludex/starlette#1966
starlette has made a release
0.23.0, but the latest FastAPI pins a specific versionstarlette==0.22.0Thus, as a dev, I can't use the latest "features" or more like reasonable expectations for the TestClient.
A newcomer would read the docs / source code and would expect TestClient to accept headers kwarg and get confused why that's rejected.
Thus, the question: is there a reason to pin a specific version of starlette?
Operating System
Other
Operating System Details
An issue with any OS.
FastAPI Version
0.88.0
Python Version
3.10, etc.
Additional Context
No response