Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show actuall request when umocked requests are made #250

Closed
dolfandringa opened this issue Jan 17, 2024 · 3 comments
Closed

Show actuall request when umocked requests are made #250

dolfandringa opened this issue Jan 17, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@dolfandringa
Copy link

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.

@lundberg
Copy link
Owner

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

@lundberg
Copy link
Owner

Kind-of related to #244

@lundberg lundberg added the enhancement New feature or request label Mar 18, 2024
@lundberg
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants