Theron Luhn
2015-11-10 17:26:22 UTC
asyncio.iscoroutinefunction(unittest.mock.Mock())
<Mock name='mock._is_coroutine' id='4544068072'>This is an unexpected response, both in type (Mock rather than boolean) and value (truthy).
inspect.iscoroutinefunction behaves as expected.
m = unittest.mock.Mock()
m._is_coroutine = False
asyncio.iscoroutinefunction(m)
Falsem._is_coroutine = False
asyncio.iscoroutinefunction(m)
----------
components: asyncio
messages: 254457
nosy: Theron Luhn, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
_______________________________________
Python tracker <***@bugs.python.org>
<http://bugs.python.org/issue25599>
_______________________________________