Skip to main content

A utility for mocking out the Python HTTPX library.

Project description

RESPX

codecov PyPi Version Python Versions

A utility for mocking out the Python HTTPX library.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respx-0.8.3.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

respx-0.8.3-py2.py3-none-any.whl (15.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page