pytest fixture for HTTPX
This module is still under development and cannot be considered stable.
Use pytest_httpx.httpx_mock pytest fixture to mock httpx requests.
Add responses
import httpx
from pytest_httpx import httpx_mock, HTTPXMock
def test_something(httpx_mock: HTTPXMock):
httpx_mock.add_response("http://test_url")
response = httpx.get("http://test_url")
If all responses are not sent back during test execution, the test case will fail.
Check sent requests
import httpx
from pytest_httpx import httpx_mock, HTTPXMock
def test_something(httpx_mock: HTTPXMock):
httpx_mock.add_response("http://test_url")
response = httpx.get("http://test_url")
# requests are in httpx_mock.requests
Metadata
Release files for pytest-httpx 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytest_httpx-0.0.1.tar.gz | 3.5 kB | Without provenance | Details for pytest_httpx-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_httpx-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for pytest_httpx-0.0.1-py3-none-any.whl |
Total release size: 8.2 kB
Release files / pytest_httpx-0.0.1.tar.gz
| Download URL | pytest_httpx-0.0.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7431dc30637a00f1f0afa95713ca73a022b7f53ac6f8a00b5679baaf6a0a6cd
|
|
BLAKE2b-256 checksum How to use checksums |
9e563771603c1636b38e89be8d26cd12dc032b0db7f9487ee87e38293292f2fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7
|
Release files / pytest_httpx-0.0.1-py3-none-any.whl
| Download URL | pytest_httpx-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af6c32a86017eb4b701cc6f5cd8dc843336e479a9164059a6dfbf9536e7427f7
|
|
BLAKE2b-256 checksum How to use checksums |
0e8e00159fef20086d3f0b1b78f2a42bed03d4e8b2b84b04a4d0a15f48fdcf1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7
|
Security for pytest-httpx 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.