Message 254464 - Python tracker (original) (raw)

asyncio.iscoroutinefunction(unittest.mock.Mock())

Yeah, I already had this issue when I wrote unit tests using mock :-/ I didn't find an obvious fix for this issue, and it's quite easy to workaround it.

It looks like the "m._is_coroutine = False" is not used in asyncio tests. I don't recall how I worked around the issue in asyncio tests...