This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mads Sejersen
Recipients Mads Sejersen, asvetlov, lisroach, xtreak, yselivanov
Date 2020-03-10.08:46:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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
Date User Action Args
2020-03-10 08:46:18Mads Sejersensetrecipients: + Mads Sejersen, asvetlov, yselivanov, lisroach, xtreak
2020-03-10 08:46:18Mads Sejersensetmessageid: <>
2020-03-10 08:46:18Mads Sejersenlinkissue39915 messages
2020-03-10 08:46:18Mads Sejersencreate