Talk about how to mock async methods in different versions of Python
Unittest AsyncMockhttps://pranaysuresh.com/https://www.linkedin.com/in/pranaysuresh/
View Slide
Because...
Prior to Python 3.8Option 1: Custom solution
Prior to Python 3.8
Prior to Python 3.8Option 2: asynctest library: https://pypi.org/project/asynctest/
Python 3.8
Other features:assert_awaited, assert_awaited_once,assert_awaited_with, await_count etc etc.
Other features:Mock iterators
Other features:Mock context managers
Thank You!