diff options
author | Inada Naoki <songofacandy@gmail.com> | 2019-03-22 11:07:32 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-03-22 11:07:32 (GMT) |
commit | c5c6cdada3d41148bdeeacfe7528327b481c5d18 (patch) | |
tree | 19cd43afc4a6cf2351fe85a8beca0f2e111fdfd4 /Lib/test/test_asyncio | |
parent | b0df45e55dc8304bac0e3cad0225472b84190964 (diff) | |
download | cpython-c5c6cdada3d41148bdeeacfe7528327b481c5d18.zip cpython-c5c6cdada3d41148bdeeacfe7528327b481c5d18.tar.gz cpython-c5c6cdada3d41148bdeeacfe7528327b481c5d18.tar.bz2 |
asyncio: PendingDeprecationWarning -> DeprecationWarning (GH-12494)
`Task.current_task()` and `Task.all_tasks()` will be removed in 3.9.
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 22f14f8..1cdff52 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -1634,26 +1634,26 @@ class BaseTaskTests: def test_current_task_deprecated(self): Task = self.__class__.Task - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertIsNone(Task.current_task(loop=self.loop)) async def coro(loop): - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertIs(Task.current_task(loop=loop), task) # See http://bugs.python.org/issue29271 for details: asyncio.set_event_loop(loop) try: - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertIs(Task.current_task(None), task) - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertIs(Task.current_task(), task) finally: asyncio.set_event_loop(None) task = self.new_task(self.loop, coro(self.loop)) self.loop.run_until_complete(task) - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertIsNone(Task.current_task(loop=self.loop)) def test_current_task(self): @@ -1982,7 +1982,7 @@ class BaseTaskTests: Task = self.__class__.Task async def coro(): - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): assert Task.all_tasks(self.loop) == {t} t = self.new_task(self.loop, coro()) @@ -2012,9 +2012,9 @@ class BaseTaskTests: # See http://bugs.python.org/issue29271 for details: asyncio.set_event_loop(self.loop) try: - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertEqual(Task.all_tasks(), {task}) - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertEqual(Task.all_tasks(None), {task}) finally: asyncio.set_event_loop(None) @@ -2692,7 +2692,7 @@ class BaseTaskIntrospectionTests: self.assertEqual(asyncio.all_tasks(loop), set()) self._register_task(task) self.assertEqual(asyncio.all_tasks(loop), set()) - with self.assertWarns(PendingDeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertEqual(asyncio.Task.all_tasks(loop), {task}) self._unregister_task(task) |