[3.9] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (GH-30785)

Automerge-Triggered-By: GH:asvetlov
This commit is contained in:
Kumar Aditya 2022-01-22 18:22:24 +05:30 committed by GitHub
parent 3c4a3745b9
commit 6ed874f8c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 29 additions and 24 deletions

View file

@ -4,6 +4,7 @@
from unittest import mock
import asyncio
from types import GenericAlias
from test.test_asyncio import utils as test_utils
@ -92,6 +93,11 @@ def test_repr(self):
def test_str(self):
self._test_repr_or_str(str, False)
def test_generic_alias(self):
q = asyncio.Queue[int]
self.assertEqual(q.__args__, (int,))
self.assertIsInstance(q, GenericAlias)
def test_empty(self):
with self.assertWarns(DeprecationWarning):
q = asyncio.Queue(loop=self.loop)