A utility for mocking out the Python HTTPX and HTTP Core libraries.
Full documentation is available at lundberg.github.io/respx
import httpx
import respx
@respx.mock
def test_something():
request = respx.post("https://foo.bar/baz/", status_code=201)
response = httpx.post("https://foo.bar/baz/")
assert request.called
assert response.status_code == 201