pytest-trio
Trio's motto is Pythonic async I/O for humans (https://trio.readthedocs.io/en/latest/). It uses the same async def/await keywords of the asyncio standard module, but it is considered simpler and more friendly to use, containing some novel ideas about how to deal with timeouts and groups of parallel tasks in a way to avoid common errors in parallel programming. It is definitely worth checking out if you are into asynchronous development.
pytest-trio works similarly to pytest-asyncio: you write asynchronous test functions and mark them using the trio mark. It also provides other functionality that makes testing easier and more reliable, such as controllable clocks for testing timeouts, special functions to deal with tasks, mocking ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access