Summary
In this chapter we have walked through some of the concurrency patterns that are useful for handling common situations in asynchronous programming. Each pattern can help to maintain code that adheres to the single responsibility principle (check https://realpython.com/solid-principles-python/ for more information about SOLID principles).
A good test suite for asynchronous code doesn’t guarantee perfection, but does allow you to detect edge cases and possible race conditions. The unittest library included in standard Python is a good example that supports asynchronous mocking and fixtures, but other community-maintained libraries such as pytest can also help with testing complex scenarios.
In the next chapter we explore how asynchronous programming has been included in some of the most popular web frameworks in the Python ecosystem, some of which have evolved to support asynchronous programming while others have been asynchronous-native right from the start.
...