py.test integration for responses
Project description
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file pytest_responses-0.5.1-py2.py3-none-any.whl
.
File metadata
- Download URL: pytest_responses-0.5.1-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.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4172e565b94ac1ea3b10aba6e40855ad60cd7f141476b2d8a47e4b5f250be734 |
|
MD5 | ab189988bba0ed270930b95330a49d3d |
|
BLAKE2b-256 | c40a81b8cc3cf4b6605d97ed37217af9e2f82c97ebe130f60cf85fe82edfe0e1 |