Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/mock_vws/_httpx2_mock_server/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ def start_httpx2_router(
),
)

# HTTPX2 has no public hook for intercepting clients created before the
# mock starts. A public client extension API was proposed but closed as
# out of scope: https://github.com/pydantic/httpx2/issues/121
# RESPX patches the equivalent private HTTPX method:
# https://github.com/lundberg/respx/blob/57d8c29705fdbbaeb5cd216f1ea3bb0386d7ba16/respx/mocks.py#L150
# pylint: disable=protected-access
original_sync = httpx2.Client._transport_for_url # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
original_async = httpx2.AsyncClient._transport_for_url # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
Expand Down
Loading