Repository navigation
Add httpx2 support - #335
Closed
elviskahoro wants to merge 1 commit into
Closed
elviskahoro wants to merge 1 commit into
elviskahoro wants to merge 1 commit into
Conversation
elviskahoro
force-pushed
the
httpx2-support
branch
from
October 26, 2026 04:44
d8ab5a1 to
168abfd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for mocking
httpx2(Pydantic's fork of httpx, which depends onhttpcore2). Today respx can't mock httpx2: it patcheshttpx._client.*, andhttpx2.Responseisn't an instance ofhttpx.Response.respx/_compat.pyselects the flavour:httpxif installed, otherwisehttpx2.RESPX_HTTPX_PACKAGE=httpx2(orhttpx) forces one when both are installed.httpx/httpcorefrom the compat module, and mock targets are built from the selected package names (httpx2._client.*,httpcore2._*).httpxis installed. Added anhttpx2extra and a changelog entry.httpx, onhttpx2, and withhttpxuninstalled, at 100% coverage. Addedtests/test_compat.py.Not included: docs, and an httpx2 job in the CI matrix.