Skip to content

Commit 539d2e9

Browse files
committed
fix test_asyncio.test_free_threading
1 parent c5c5d3f commit 539d2e9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Lib/test/test_asyncio/test_free_threading.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,25 @@ class TestPyFreeThreading(TestFreeThreading, TestCase):
112112
all_tasks = staticmethod(asyncio.tasks._py_all_tasks)
113113
current_task = staticmethod(asyncio.tasks._py_current_task)
114114

115-
def factory(self, loop, coro, context=None):
116-
return asyncio.tasks._PyTask(coro, loop=loop, context=context)
115+
def factory(self, loop, coro, **kwargs):
116+
return asyncio.tasks._PyTask(coro, loop=loop, **kwargs)
117117

118118

119119
@unittest.skipUnless(hasattr(asyncio.tasks, "_c_all_tasks"), "requires _asyncio")
120120
class TestCFreeThreading(TestFreeThreading, TestCase):
121121
all_tasks = staticmethod(getattr(asyncio.tasks, "_c_all_tasks", None))
122122
current_task = staticmethod(getattr(asyncio.tasks, "_c_current_task", None))
123123

124-
def factory(self, loop, coro, context=None):
125-
return asyncio.tasks._CTask(coro, loop=loop, context=context)
124+
def factory(self, loop, coro, **kwargs):
125+
return asyncio.tasks._CTask(coro, loop=loop, **kwargs)
126126

127127

128128
class TestEagerPyFreeThreading(TestPyFreeThreading):
129-
def factory(self, loop, coro, context=None):
130-
return asyncio.tasks._PyTask(coro, loop=loop, context=context, eager_start=True)
129+
def factory(self, loop, coro, eager_start=True, **kwargs):
130+
return asyncio.tasks._PyTask(coro, loop=loop, **kwargs, eager_start=eager_start)
131131

132132

133133
@unittest.skipUnless(hasattr(asyncio.tasks, "_c_all_tasks"), "requires _asyncio")
134134
class TestEagerCFreeThreading(TestCFreeThreading, TestCase):
135-
def factory(self, loop, coro, context=None):
136-
return asyncio.tasks._CTask(coro, loop=loop, context=context, eager_start=True)
135+
def factory(self, loop, coro, *, eager_start=True, **kwargs):
136+
return asyncio.tasks._CTask(coro, loop=loop, **kwargs, eager_start=eager_start)

0 commit comments

Comments
 (0)