From ea5b96842e066623a53015d8b2492ed61a5baf96 Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Sat, 22 Jan 2022 16:58:53 +0530 Subject: bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Jelle Zijlstra --- Lib/test/test_asyncio/test_futures.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_asyncio/test_futures.py') diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py index 95983f0550..84d7d45af9 100644 --- a/Lib/test/test_asyncio/test_futures.py +++ b/Lib/test/test_asyncio/test_futures.py @@ -7,7 +7,7 @@ import sys import threading import unittest from unittest import mock - +from types import GenericAlias import asyncio from asyncio import futures from test.test_asyncio import utils as test_utils @@ -109,6 +109,11 @@ class BaseFutureTests: self.loop = self.new_test_loop() self.addCleanup(self.loop.close) + def test_generic_alias(self): + future = self.cls[str] + self.assertEqual(future.__args__, (str,)) + self.assertIsInstance(future, GenericAlias) + def test_isfuture(self): class MyFuture: _asyncio_future_blocking = None -- cgit v1.2.1