Message351392
I see your point it is confusing the difference between the async and sync API, but I think the current AsyncMock call check is correct. According to the asyncio docs: "...simply calling a coroutine will not schedule it to be executed" (https://docs.python.org/3/library/asyncio-task.html#coroutines) and it goes on to say you either need to call the function with await, asyncio.run(), or asyncio.create_task().
So I believe calling an AsyncMock without using await should not log as a call, it is only if one of the three criteria above is met that it should be added to the mock_calls list. |
|
Date |
User |
Action |
Args |
2019-09-09 09:55:22 | lisroach | set | recipients:
+ lisroach, cjw296, michael.foord, mariocj89, xtreak |
2019-09-09 09:55:22 | lisroach | set | messageid: <1568022922.84.0.738410307269.issue37383@roundup.psfhosted.org> |
2019-09-09 09:55:22 | lisroach | link | issue37383 messages |
2019-09-09 09:55:22 | lisroach | create | |
|