lundberg/respx

Show actuall request when umocked requests are made

Closed this issue · 3 comments

I have a unittest that uses respx through the pytest fixture to mock the http requests. I changed something in the code, and now a bunch of tests are failing with respx.models.AllMockedAssertionError: RESPX: <Request('POST', 'https://our.partner.example.com/their/webhook')> not mocked!.

So far, hurray for unittests. But it doesn't show me what request was actually made. It would be great if there was some kind of output showing the mocked requests and the actual requests, so I can see the difference. Now i am just guessing what the issue is. Pytest normally can show diffs on assertion errors with plain values.

The "all mocked assertion" means that respx is active and configured to require every httpx request to match respx mock route, i.e. the request above (https://our.partner.example.com/their/webhook) does not match any route in your respx fixture instance.

Need more details/example, e.g. fixture some the unittest that fails

Kind-of related to #244

Need more context, closing this for now. Please re-open if still a problem and/or docs should be adjusted.