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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db130b9ae4729faa68d8dc2ec59b6223bbcda93f312135eb60987b1dd78ffead
|
|
| MD5 |
4d7c970d0bd4c6f7ba05062111c959cb
|
|
| BLAKE2b-256 |
66789e2ced5968b680b13548f97287fa85e9e9a36a6e91e4d830de0bdd39d6b4
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
614d3120522030004949f2ddd6018b85e5cf569237709ae253d929e87716a55a
|
|
| MD5 |
576cc70d40985626400cd10b7b4ccae7
|
|
| BLAKE2b-256 |
f23dd408c7d4d4d166bab5fe0b0ecdc34f934750d69d3697bd88f0a8eff87f0f
|