respx
respx copied to clipboard
Mock HTTPX with awesome request patterns and response side effects 🦋
We run code alike this: ```python import httpx import pytest import respx from respx.mocks import HTTPCoreMocker @pytest.mark.asyncio async def test_asgi(): try: HTTPCoreMocker.add_targets( "httpx._transports.asgi.ASGITransport", "httpx._transports.wsgi.WSGITransport", ) async with respx.mock: async with...
With pytest-asyncio==0.19.0 the asyncio-mode has been defaulted to strict. This breaks most of respx's tests. https://github.com/pytest-dev/pytest-asyncio#modes
Consider raising a warning when a configured decorated function is missing the `respx_mock` arg. Related to #196.
I'm wondering if it could be possible to support reusing _some_ settings of a `MockRouter` instance, when invoking `__call__`. Basically that'll allow me to specify a `MockRouter` with defaults, and...
Adds router settings to the rollback functionality, as well as a function `configure()` which allows changing the settings of the router, creating a new snapshot. Closes #181
Hi, I have a use-case where I'm querying over 80 different endpoints. Currently the outputs are verified using pytest-snapshot. But the tests won't run fast as the HTTP calls have...
It appears that pass-through calls are seeing 2x the actual call count. Is this behavior expected? ```py import httpx import respx with respx.mock as mock: route = respx.get('https://example.com').pass_through() httpx.get('https://example.com') print(f'pass_through()...
It might be of use if RESPX had a `MockStream` utility that could be passed as stream when creating a `httpx.Response`. The `MockStream` should suport both *sync* and *async* contexts....
Should RESPX maybe use [httpx.json](https://github.com/encode/httpx/pull/1352) once merged and released?
As mentioned in #87, it might be of interest to allow matching a request on files being sent. - What do we want to match on? - Is it even...