Skip to main content
https://img.shields.io/pypi/v/pytest-responses.svg https://github.com/getsentry/pytest-responses/workflows/Test/badge.svg

Automatically activate responses across your py.test-powered test suite (thus preventing HTTP requests).

$ pip install pytest-responses

If particular tests need access to external domains, you can use the withoutresponses marker:

@pytest.mark.withoutresponses
def test_disabled():
    with pytest.raises(ConnectionError):
        requests.get('http://responses.invalid')

    assert len(responses.calls) == 0

Additionally, you can use the responses fixture:

def test_enabled(responses):
    with pytest.raises(ConnectionError):
        requests.get('http://responses.invalid')

    assert len(responses.calls) == 1

Metadata

Release files for pytest3-responses 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest3-responses 0.5.0
File Size Uploaded
pytest3-responses-0.5.0.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest3-responses 0.5.0
File Interpreter ABI Platform
pytest3_responses-0.5.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.2 kB

Release files / pytest3-responses-0.5.0.tar.gz

Download URL pytest3-responses-0.5.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
db130b9ae4729faa68d8dc2ec59b6223bbcda93f312135eb60987b1dd78ffead
BLAKE2b-256 checksum
How to use checksums
66789e2ced5968b680b13548f97287fa85e9e9a36a6e91e4d830de0bdd39d6b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.2

Release files / pytest3_responses-0.5.0-py2.py3-none-any.whl

Download URL pytest3_responses-0.5.0-py2.py3-none-any.whl
Size 6.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
614d3120522030004949f2ddd6018b85e5cf569237709ae253d929e87716a55a
BLAKE2b-256 checksum
How to use checksums
f23dd408c7d4d4d166bab5fe0b0ecdc34f934750d69d3697bd88f0a8eff87f0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page