Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:
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 ---------- nosy: +xtreak resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue25599> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com