Skip to main content

py.test integration for responses

Project description

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

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

pytest3-responses-0.5.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

pytest3_responses-0.5.0-py2.py3-none-any.whl (6.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pytest3-responses-0.5.0.tar.gz.

File metadata

  • Download URL: pytest3-responses-0.5.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pytest3-responses-0.5.0.tar.gz
Algorithm Hash digest
SHA256 db130b9ae4729faa68d8dc2ec59b6223bbcda93f312135eb60987b1dd78ffead
MD5 4d7c970d0bd4c6f7ba05062111c959cb
BLAKE2b-256 66789e2ced5968b680b13548f97287fa85e9e9a36a6e91e4d830de0bdd39d6b4

See more details on using hashes here.

File details

Details for the file pytest3_responses-0.5.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest3_responses-0.5.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for pytest3_responses-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 614d3120522030004949f2ddd6018b85e5cf569237709ae253d929e87716a55a
MD5 576cc70d40985626400cd10b7b4ccae7
BLAKE2b-256 f23dd408c7d4d4d166bab5fe0b0ecdc34f934750d69d3697bd88f0a8eff87f0f

See more details on using hashes here.

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