Following test
import httpx
import respx
from httpx import Response
with respx.mock(using="httpx") as rsps:
rsps.get("http://example.org/", params={"page": 0}).mock(Response(200))
rsps.get("http://example.org/", params={"page": 1}).mock(Response(400))
response_1 = httpx.get("http://example.org/", params={"page": 0})
assert response_1.status_code == 200
response_2 = httpx.get("http://example.org/", params={"page": 1})
assert response_2.status_code == 400
runs properly up to respx 0.22.0, but it fails in 0.23.0 with
respx.models.AllMockedAssertionError: RESPX: <Request('GET', 'http://example.org/?page=0')> not mocked!
I was able to debug to a point that second mock overrides the first mock, even though they mock for a different requests.
Following test
runs properly up to respx 0.22.0, but it fails in 0.23.0 with
I was able to debug to a point that second mock overrides the first mock, even though they mock for a different requests.