mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +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
|
|
@ -9,12 +9,13 @@
|
|||
import random
|
||||
import re
|
||||
import sys
|
||||
import types
|
||||
import textwrap
|
||||
import traceback
|
||||
import types
|
||||
import unittest
|
||||
import weakref
|
||||
from unittest import mock
|
||||
from types import GenericAlias
|
||||
|
||||
import asyncio
|
||||
from asyncio import coroutines
|
||||
|
|
@ -120,6 +121,12 @@ def setUp(self):
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue