diff options
author | Wulian <1055917385@qq.com> | 2024-08-11 16:35:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-11 16:35:51 (GMT) |
commit | bc9d92c67933917b474e61905451c6408c68e71d (patch) | |
tree | 3cbe6bee6f8d7029f26b7bdfdb5c57873088e073 /Lib/unittest | |
parent | 3aaed083a3f5eb7e490495c460b3dc1ce7451ce8 (diff) | |
download | cpython-bc9d92c67933917b474e61905451c6408c68e71d.zip cpython-bc9d92c67933917b474e61905451c6408c68e71d.tar.gz cpython-bc9d92c67933917b474e61905451c6408c68e71d.tar.bz2 |
gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)
Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`.
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Diffstat (limited to 'Lib/unittest')
-rw-r--r-- | Lib/unittest/mock.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 2bbbcf4..480c85b 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -32,7 +32,7 @@ import pprint import sys import builtins import pkgutil -from asyncio import iscoroutinefunction +from inspect import iscoroutinefunction import threading from types import CodeType, ModuleType, MethodType from unittest.util import safe_repr @@ -2456,7 +2456,7 @@ class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): recognized as an async function, and the result of a call is an awaitable: >>> mock = AsyncMock() - >>> iscoroutinefunction(mock) + >>> inspect.iscoroutinefunction(mock) True >>> inspect.isawaitable(mock()) True |