Technical requirements
For this chapter, we will use some external packages to extend the basic asyncio library. First, we will use pytest as a testing library, along with a couple of extensions (pytest-asyncio and pytest-xdist) to run tests for asyncio and also be able to run them in parallel. Of course, the same concepts apply for any other library (e.g. the standard module unittest). Then instead of consuming actual external resources we will mock responses using aioresponse. As usual, all the source code is available in the Github repository, in the Chapter06 folder (https://github.com/PacktPublishing/Asynchronous-Programming-in-Python). Remember to generate a virtual environment exclusively for the chapter. That way, the additional packages will not interfere with other requirements:
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt