mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
gh-128308: pass **kwargs
to asyncio task_factory (#128768)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
6c914bf85c
commit
38a9956876
8 changed files with 48 additions and 29 deletions
|
@ -1040,6 +1040,18 @@ class BaseTestTaskGroup:
|
|||
self.assertIsNotNone(exc)
|
||||
self.assertListEqual(gc.get_referrers(exc), no_other_refs())
|
||||
|
||||
async def test_name(self):
|
||||
name = None
|
||||
|
||||
async def asyncfn():
|
||||
nonlocal name
|
||||
name = asyncio.current_task().get_name()
|
||||
|
||||
async with asyncio.TaskGroup() as tg:
|
||||
tg.create_task(asyncfn(), name="example name")
|
||||
|
||||
self.assertEqual(name, "example name")
|
||||
|
||||
|
||||
class TestTaskGroup(BaseTestTaskGroup, unittest.IsolatedAsyncioTestCase):
|
||||
loop_factory = asyncio.EventLoop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue