diff options
-rw-r--r-- | asyncio/tasks.py | 2 | ||||
-rw-r--r-- | tests/test_tasks.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/asyncio/tasks.py b/asyncio/tasks.py index 5840d2a..f617b62 100644 --- a/asyncio/tasks.py +++ b/asyncio/tasks.py @@ -506,7 +506,7 @@ def async(coro_or_future, *, loop=None): """ warnings.warn("asyncio.async() function is deprecated, use ensure_future()", - RuntimeWarning) + DeprecationWarning) return ensure_future(coro_or_future, loop=loop) diff --git a/tests/test_tasks.py b/tests/test_tasks.py index 8c79983..4119085 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -158,7 +158,7 @@ class TaskTests(test_utils.TestCase): def test_async_warning(self): f = asyncio.Future(loop=self.loop) - with self.assertWarnsRegex(RuntimeWarning, + with self.assertWarnsRegex(DeprecationWarning, 'function is deprecated, use ensure_'): self.assertIs(f, asyncio.async(f)) |