/respx

A utility for mocking out the Python HTTPX and HTTP Core libraries. 🦋

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

RESPX

codecov PyPi Version Python Versions

A utility for mocking out the Python HTTPX and HTTP Core libraries.

Documentation

Full documentation is available at lundberg.github.io/respx

QuickStart

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