aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_asyncio/test_tasks.py
diff options
context:
space:
mode:
authorWulian <1055917385@qq.com>2024-08-12 00:35:51 +0800
committerGitHub <noreply@github.com>2024-08-11 16:35:51 +0000
commitbc9d92c67933917b474e61905451c6408c68e71d (patch)
tree3cbe6bee6f8d7029f26b7bdfdb5c57873088e073 /Lib/test/test_asyncio/test_tasks.py
parent3aaed083a3f5eb7e490495c460b3dc1ce7451ce8 (diff)
downloadcpython-bc9d92c67933917b474e61905451c6408c68e71d.tar.gz
cpython-bc9d92c67933917b474e61905451c6408c68e71d.zip
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/test/test_asyncio/test_tasks.py')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 9b22fb942c6..a1013ab8033 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -20,6 +20,7 @@ from asyncio import tasks
from test.test_asyncio import utils as test_utils
from test import support
from test.support.script_helper import assert_python_ok
+from test.support.warnings_helper import ignore_warnings
def tearDownModule():
@@ -1939,6 +1940,7 @@ class BaseTaskTests:
self.assertFalse(task.cancelled())
self.assertIs(task.exception(), base_exc)
+ @ignore_warnings(category=DeprecationWarning)
def test_iscoroutinefunction(self):
def fn():
pass
@@ -1956,6 +1958,7 @@ class BaseTaskTests:
self.assertFalse(asyncio.iscoroutinefunction(mock.Mock()))
self.assertTrue(asyncio.iscoroutinefunction(mock.AsyncMock()))
+ @ignore_warnings(category=DeprecationWarning)
def test_coroutine_non_gen_function(self):
async def func():
return 'test'