3 ms·
There were 2 things about asyncio that I really didn't like: 1. the library constantly changed under our feet and that also meant that Stack Overflow articles
by t-writescode 6y ago
There were 2 things about asyncio that I really didn't like:
1. the library constantly changed under our feet and that also meant that Stack Overflow articles were all over the place between Python 3.5 and 3.7.
2. I don't think I've ever successfully mocked an async function in python. This made testing async code in python, especially mocking responses from an async web call (an obvious use of async in python) very difficult, if memory serves me. It's been several months since I've used async in python (job change) though, so maybe it's gotten easier or maybe the exact mocking test case issues I had are different drom what I think.
- xtreak29 6y agoFrom Python 3.8 there is AsyncMock : https://docs.python.org/3/library/unittest.mock.html#unittest.mock.AsyncMock https://docs.python.org/3/library/unittest.mock.html#unittes... . It's also available on mock backport from pypi for other versions. It's based on asynctest module. https://pypi.org/project/asynctest/ https://pypi.org/project/asynctest/