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
Close
Hashes for pytest_responses-0.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fffd7412294c8a01ccfec05ae51910db76aeb0df877c5fac16c64991cb465e6 |
|
MD5 | 73de988da212c71e61b243a410f462a2 |
|
BLAKE2b-256 | 79d5dfac65ad562ce0e9bf95e001738826f1527f6a61817a4e4a0f1d9503a6ed |