diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-01-22 12:28:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-22 12:28:51 (GMT) |
commit | 90e2998db78cd15e45b3c82f6360ac8841e03945 (patch) | |
tree | 534efde7eb1062aef3b613150d2d19e247faf827 /Lib/test/test_asyncio/test_tasks.py | |
parent | d4a9e34401d519250d3b3744cd10394069f748c1 (diff) | |
download | cpython-90e2998db78cd15e45b3c82f6360ac8841e03945.zip cpython-90e2998db78cd15e45b3c82f6360ac8841e03945.tar.gz cpython-90e2998db78cd15e45b3c82f6360ac8841e03945.tar.bz2 |
[3.10] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (#30784)
* bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777)
* bpo-46469: Make asyncio generic classes return GenericAlias
* 📜🤖 Added by blurb_it.
* Update Misc/NEWS.d/next/Library/2022-01-22-05-05-08.bpo-46469.plUab5.rst
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit ea5b96842e066623a53015d8b2492ed61a5baf96)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* Fix tests
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 1c05944..4782c92 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -15,6 +15,7 @@ import types import unittest import weakref from unittest import mock +from types import GenericAlias import asyncio from asyncio import coroutines @@ -120,6 +121,12 @@ class BaseTaskTests: self.loop.set_task_factory(self.new_task) self.loop.create_future = lambda: self.new_future(self.loop) + + def test_generic_alias(self): + task = self.__class__.Task[str] + self.assertEqual(task.__args__, (str,)) + self.assertIsInstance(task, GenericAlias) + def test_task_cancel_message_getter(self): async def coro(): pass |