Author xtreak
Recipients gvanrossum, jcea, josephgordon, luhn, vstinner, xtreak, yselivanov
Date 2019-06-12.18:13:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560363207.45.0.321808195338.issue25599@roundup.psfhosted.org>
In-reply-to
Content
I guess the inconsistency in original report is fixed with issue28703 where both inspect.iscoroutinefunction and asyncio.iscoroutinefunction return False for Mock(). The fix is available from 3.5.3 . There is also async support for mock added in 3.8 with issue26467. I am closing this as part of triaging. Feel free to reopen this if I am missing something. Thanks.

# Python 3.5

python3.5
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> from unittest.mock import *
>>> asyncio.iscoroutinefunction(Mock())
<Mock name='mock._is_coroutine' id='140563339256496'>

# Master

./python.exe
Python 3.9.0a0 (heads/master:daf6262751, Jun 12 2019, 23:12:37)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from unittest.mock import Mock
>>> import asyncio, inspect
>>> inspect.iscoroutinefunction(Mock())
False
>>> asyncio.iscoroutinefunction(Mock())
False
History
Date User Action Args
2019-06-12 18:13:27xtreaksetrecipients: + xtreak, gvanrossum, jcea, vstinner, yselivanov, josephgordon, luhn
2019-06-12 18:13:27xtreaksetmessageid: <1560363207.45.0.321808195338.issue25599@roundup.psfhosted.org>
2019-06-12 18:13:27xtreaklinkissue25599 messages
2019-06-12 18:13:27xtreakcreate