You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If test_first is called before test_second, the request in test_second will pass through to "localhost" but in that case I want to be able to block the request
I managed to figure out that since it's a global object involved I can create a fixture that wraps the pass through in a snapshot that'll get rolled back.
It auto-enables respx mocking essentially doing duplicate work, and it's slightly more verbose but that's only visible in the allowing fixture. But it's something that works at least.
In my suite a want the global default behaviour of disabling all external calls, unless explicitly excepted by a pass through.
I have the following fixture in a "root conftest.py" disabling calls:
But now I want to, for a limited part of my tests, pass through some external request e.g.
But as far as I can tell, the above pass through is globally configured. Which means that after I've called
.pass_through()
there's no reverting it.Optimally I'd like to scope the pass through for a limited context, e.g.
The text was updated successfully, but these errors were encountered: