Mads Sejersen <[email protected]> added the comment:
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())
```
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39915>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com