[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-11-11 Thread Theron Luhn
Theron Luhn added the comment: For me, the context is a test I was writing that went something like this: >>> import asyncio >>> from unittest.mock import Mock >>> loop = asyncio.get_event_loop() >>> blocking_func = Mock() >>> loop.run_in_executo

[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-11-10 Thread Theron Luhn
New submission from Theron Luhn: >>> asyncio.iscoroutinefunction(unittest.mock.Mock()) This is an unexpected response, both in type (Mock rather than boolean) and value (truthy). inspect.iscoroutinefunction behaves as expected. Workaround: >>> m = unittest.mock.Mock() &