Skip to content

Use httpx2 for starlette's TestClient - #531

Merged
markusressel merged 1 commit into
masterfrom
dev-httpx2
Oct 31, 2026
Merged

markusressel merged 1 commit into
masterfrom
dev-httpx2

Conversation

@markusressel

Copy link
Copy Markdown
Owner

starlette 1.10 deprecates httpx for starlette.testclient, pytest printed:

StarletteDeprecationWarning: Using httpx with starlette.testclient is deprecated; install httpx2 instead.

This replaces the dev dependency httpx with httpx2 (^2.16.0, https://github.com/pydantic/httpx2). starlette's TestClient imports httpx2 first. No test code imports httpx directly.

Lock changes are limited to the dev group: httpx/httpcore are replaced by httpx2/httpcore2 (plus their dependencies httpx2-jsfetch and truststore). No runtime dependency changed.

Verified locally: poetry run pytest (88 passed, the deprecation warning is gone).

🤖 Generated with Claude Code

starlette 1.10 deprecates httpx for starlette.testclient and prints
"Using `httpx` with `starlette.testclient` is deprecated; install `httpx2`
instead." Replace the dev dependency httpx with httpx2 (pydantic/httpx2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markusressel
markusressel merged commit 324ee58 into master Oct 31, 2026
8 checks passed
@markusressel
markusressel deleted the dev-httpx2 branch October 31, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant