Repository navigation
httpx deprecated for starlette TestClient #15742
Answered
by
YuriiMotov
sakshamgoyal-01
asked this question in
Questions
First Check
Commit to Help
Example Codefrom fastapi.testclient import TestClient
def test_health_returns_200(client: TestClient):
resp = client.get("/health")
assert resp.status_code == 200Description.venv/lib/python3.14/site-packages/fastapi/testclient.py:1
/home/[redacted]/.venv/lib/python3.14/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.htmlOperating SystemLinux Operating System DetailsNo response FastAPI Version0.136.3 Pydantic Version2.13.4 Python Version3.14 Additional ContextUsing |
Answered by
YuriiMotov
Jun 12, 2026
Replies: 4 comments 4 replies
|
You just need to add |
2 replies
Answer selected by
sakshamgoyal-01
This comment was marked as low quality.
This comment was marked as low quality.
2 replies
|
Can it be removed in fastapi[standard]? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You just need to add
httpx2to your project dependencies