Jonas Lundberg

Results 82 comments of Jonas Lundberg

Thanks, we should address the warnings 👍 About the `test_respx_mock_fixture` test, it's testing that the `pytest` respx plugin works by supplying/forcing `-p respx` when executing, to simulate a proper user...

Thanks for reporting @Skeen. I've narrowed down the problem to the `Path` pattern [here](https://github.com/lundberg/respx/blob/master/respx/patterns.py#L432-L433). Both `urljoin("/", "///")` and `httpx.URL("///")` turns e.g. `///` into a single `/` path 🤔

Looked a bit more, and regarding `urljoin`, we'll need to change to a simple conditional slash prepend. Regarding `httpx.URL("///")`, this unfortunately is treated as first two first `//` as scheme/host...

> I have a difficulty try to mock stream response for a endpoint for both sync and async calls, because they expects different stream types, and side effect handler don't...

Looks promising .. I'll revisit this 👍

How to globally enable `respx` is a great suggestion to the docs. Normally I use an auto-used session scoped fixture for this, e.g. `@pytest.fixture(scope="session", autouse=True)`. An autouse fixture may be...

Well, mocking httpx for the test suite globally is preferred, preventing any external unwanted/accidental calls to be made .. at least IMO 😉 i.e. it's a good workflow when the...

BTW, the idea behind #227 is to allow the user to configure respx's default response/sideeffect e.g. `NetworkError`, to optionally simulating lack of network/remote access, and enforce the user to mock...

You're right, it probably doesn't work .. but if it would, then the _call_ is the actual `request` + optional `response`, which may not be what you want to assert...