diff options
author | Wulian <1055917385@qq.com> | 2024-08-12 00:35:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-11 16:35:51 +0000 |
commit | bc9d92c67933917b474e61905451c6408c68e71d (patch) | |
tree | 3cbe6bee6f8d7029f26b7bdfdb5c57873088e073 /Lib/test/test_asyncio/test_tasks.py | |
parent | 3aaed083a3f5eb7e490495c460b3dc1ce7451ce8 (diff) | |
download | cpython-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.py | 3 |
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' |