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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pytest3_responses-0.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 614d3120522030004949f2ddd6018b85e5cf569237709ae253d929e87716a55a |
|
MD5 | 576cc70d40985626400cd10b7b4ccae7 |
|
BLAKE2b-256 | f23dd408c7d4d4d166bab5fe0b0ecdc34f934750d69d3697bd88f0a8eff87f0f |