python3-pytest-httpx

Intercept and mock HTTPX requests in pytest

Description

Provides an `httpx_mock` fixture for the pytest framework. This fixture allows you to intercept and mock HTTP requests made using the HTTPX library. It supports both synchronous and asynchronous HTTPX requests, enabling you to define custom responses, including JSON bodies, headers, status codes, and more.

This library is useful for testing scenarios where making actual network calls is not feasible or desired. You can simulate various HTTP responses and conditions, ensuring your code handles them correctly. Additionally, pytest-httpx supports dynamic responses via callbacks, request verification, and partial mocking, allowing specific requests to go through unmocked.

Ideal for developers needing to test HTTP interactions in their applications without relying on external services.

Upload more screenshots

Please help extend the collection of screenshots. Just make a screenshot and upload it here. You don't need to register or anything.

Upload a screenshot

Hint: upload an image here from your clipboard with Ctrl-V


Homepage

https://github.com/Colin-b/pytest_httpx


Install this software package

If the package is available for the distribution you are currently using on your computer then install the software by clicking on…

Install python3-pytest-httpx