Message363815
It can actually be boiled down to an even more minimal example. It looks like the problem is that the function call is stored for later when called, then overwritten by other subsequent calls. Then, once awaited, the latest registered call is added to the await_args_list instead of the call that actually happened.
```
import asyncio
from unittest.mock import AsyncMock
async def main():
foo = AsyncMock()
foo1 = foo(1)
foo2 = foo(2)
await foo1
await foo2
print(foo.await_args_list)
asyncio.run(main())
``` |
|
Date |
User |
Action |
Args |
2020-03-10 08:46:18 | Mads Sejersen | set | recipients:
+ Mads Sejersen, asvetlov, yselivanov, lisroach, xtreak |
2020-03-10 08:46:18 | Mads Sejersen | set | messageid: <1583829978.21.0.846827401797.issue39915@roundup.psfhosted.org> |
2020-03-10 08:46:18 | Mads Sejersen | link | issue39915 messages |
2020-03-10 08:46:18 | Mads Sejersen | create | |
|