mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
[3.9] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (GH-30785)
Automerge-Triggered-By: GH:asvetlov
This commit is contained in:
parent
3c4a3745b9
commit
6ed874f8c5
8 changed files with 29 additions and 24 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue