fix tests in test_asyncio.test_tasks to use correct all_tasks (#129815)

This commit is contained in:
Kumar Aditya 2025-02-07 21:46:26 +05:30 committed by GitHub
parent a93a5a39fb
commit f52a3a51eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2757,7 +2757,6 @@ def add_subclass_tests(cls):
# Add patched Task & Future back to the test case
cls.Task = Task
cls.Future = Future
cls.all_tasks = tasks.all_tasks
# Add an extra unit-test
cls.test_subclasses_ctask_cfuture = test_subclasses_ctask_cfuture
@ -2883,7 +2882,7 @@ class PyTask_CFutureSubclass_Tests(BaseTaskTests, test_utils.TestCase):
Future = getattr(futures, '_CFuture', None)
Task = tasks._PyTask
all_tasks = tasks._py_all_tasks
all_tasks = staticmethod(tasks._py_all_tasks)
@unittest.skipUnless(hasattr(tasks, '_CTask'),
@ -2916,7 +2915,7 @@ class PyTask_PyFuture_Tests(BaseTaskTests, SetMethodsTest,
class PyTask_PyFuture_SubclassTests(BaseTaskTests, test_utils.TestCase):
Task = tasks._PyTask
Future = futures._PyFuture
all_tasks = staticmethod(tasks._py_all_tasks)
@unittest.skipUnless(hasattr(tasks, '_CTask'),
'requires the C _asyncio module')