[New-bugs-announce] [issue38136] Remove AsyncMock.assert_awaited_*

Lisa Roach report at bugs.python.org
Thu Sep 12 08:40:20 EDT 2019


New submission from Lisa Roach <lisaroach14 at gmail.com>:

After some discussion about call_count vs await_count, I believe call_count should be counting when things are *awaited* (await foo()), not when they are *called* (foo()). 

I think people expect "calling" to execute the code and give them a return_value, which for asyncio is what happens when you await, not when you call with (). If people disagree about this I am open to discussion, we can change the current functionality and leave in the assert_awaited_* calls.

Currently the code does count asyncio calls when they are awaited, but this makes the assert_awaited_* calls redundant. 

We should remove these in favor of the call_count_* functions.

----------
assignee: lisroach
components: Library (Lib)
messages: 352144
nosy: cjw296, ezio.melotti, lisroach, michael.foord, xtreak
priority: normal
severity: normal
status: open
title: Remove AsyncMock.assert_awaited_*
type: behavior
versions: Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list