Getting Started with HTTPX, Part 4: pytest-asyncio and pytest_httpx (Asynchronous Version)
In Part 2, we explored how to write tests and mocks using pytest and pytest_httpx for the synchronous version of the client, which was built in Part 1.
In Part 2, we explored how to write tests and mocks using pytest and pytest_httpx for the synchronous version of the client, which was built in Part 1.
HTTPX is a modern HTTP client library for Python. Its interface is similar to the old standby Requests, but it supports asynchronous HTTP requests, using Python’s asyncio library (or trio). In other words, while your program is waiting for an HTTP request to finish, other work does not need to be blocked.