Issue #28703: Fix asyncio.iscoroutinefunction to handle Mock objects. · python/cpython@0ed20cd · GitHub
Skip to content

Commit 0ed20cd

Browse files
author
Yury Selivanov
committed
Issue #28703: Fix asyncio.iscoroutinefunction to handle Mock objects.
1 parent 2f84144 commit 0ed20cd

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

Lib/asyncio/coroutines.py

Lines changed: 14 additions & 2 deletions

Lib/test/test_asyncio/test_tasks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,8 @@ def fn2():
13761376
yield
13771377
self.assertTrue(asyncio.iscoroutinefunction(fn2))
13781378

1379+
self.assertFalse(asyncio.iscoroutinefunction(mock.Mock()))
1380+
13791381
def test_yield_vs_yield_from(self):
13801382
fut = asyncio.Future(loop=self.loop)
13811383

Misc/NEWS

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)