PyDocs

Nav

Development Tools

AsyncMock.await_args

This is either None (if the mock hasn’t been awaited), or the arguments that the mock was last awaited with. Functions the same as Mock.call_args.
1 Example
>>> mock = AsyncMock()
>>> async def main(*args):
...     await mock(*args)
...
>>> mock.await_args
>>> asyncio.run(main('foo'))
>>> mock.await_args
call('foo')
>>> asyncio.run(main('bar'))
>>> mock.await_args
call('bar')
from the Python docs
See Also
No see-alsos for unittest.mock/AsyncMock.await_args
0 Notes
No notes for AsyncMock.await_args