[issue38161] AsyncMock add `.awaited` like `.called`

Lisa Roach report at bugs.python.org
Fri Sep 20 00:03:21 EDT 2019


Lisa Roach <lisaroach14 at gmail.com> added the comment:

Yeah I think the current `awaited` ought to at least be a private variable, since people will assume it works like a boolean to match `.called`. Then we could add a new, proper, `awaited` that would function like:

>>> mock = AsyncMock()
>>> cr_mock = mock()
>>> mock.called
True
>>> mock.awaited
False
>>> await cr_mock
>>> mock.awaited
True

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38161>
_______________________________________


More information about the Python-bugs-list mailing list