@@ -997,66 +997,66 @@ class MyKeyboardInterrupt(KeyboardInterrupt):
997997 self .assertIsNotNone (exc )
998998 self .assertListEqual (gc .get_referrers (exc ), no_other_refs ())
999999
1000- async def test_taskgroup_stop_children (self ):
1000+ async def test_taskgroup_cancel_children (self ):
10011001 # (asserting that TimeoutError is not raised)
10021002 async with asyncio .timeout (1 ):
10031003 async with asyncio .TaskGroup () as tg :
10041004 tg .create_task (asyncio .sleep (10 ))
10051005 tg .create_task (asyncio .sleep (10 ))
10061006 await asyncio .sleep (0 )
1007- tg .stop ()
1007+ tg .cancel ()
10081008
1009- async def test_taskgroup_stop_body (self ):
1009+ async def test_taskgroup_cancel_body (self ):
10101010 count = 0
10111011 async with asyncio .TaskGroup () as tg :
1012- tg .stop ()
1012+ tg .cancel ()
10131013 count += 1
10141014 await asyncio .sleep (0 )
10151015 count += 1
10161016 self .assertEqual (count , 1 )
10171017
1018- async def test_taskgroup_stop_idempotent (self ):
1018+ async def test_taskgroup_cancel_idempotent (self ):
10191019 count = 0
10201020 async with asyncio .TaskGroup () as tg :
1021- tg .stop ()
1022- tg .stop ()
1021+ tg .cancel ()
1022+ tg .cancel ()
10231023 count += 1
10241024 await asyncio .sleep (0 )
10251025 count += 1
10261026 self .assertEqual (count , 1 )
10271027
1028- async def test_taskgroup_stop_after_exit (self ):
1028+ async def test_taskgroup_cancel_after_exit (self ):
10291029 async with asyncio .TaskGroup () as tg :
10301030 await asyncio .sleep (0 )
10311031 # (asserting that exception is not raised)
1032- tg .stop ()
1032+ tg .cancel ()
10331033
1034- async def test_taskgroup_stop_before_enter (self ):
1034+ async def test_taskgroup_cancel_before_enter (self ):
10351035 tg = asyncio .TaskGroup ()
1036- tg .stop ()
1036+ tg .cancel ()
10371037 count = 0
10381038 async with tg :
10391039 count += 1
10401040 await asyncio .sleep (0 )
10411041 count += 1
10421042 self .assertEqual (count , 1 )
10431043
1044- async def test_taskgroup_stop_before_exception (self ):
1044+ async def test_taskgroup_cancel_before_exception (self ):
10451045 async def raise_exc (parent_tg : asyncio .TaskGroup ):
1046- parent_tg .stop ()
1046+ parent_tg .cancel ()
10471047 raise RuntimeError
10481048
10491049 with self .assertRaises (ExceptionGroup ):
10501050 async with asyncio .TaskGroup () as tg :
10511051 tg .create_task (raise_exc (tg ))
10521052 await asyncio .sleep (1 )
10531053
1054- async def test_taskgroup_stop_after_exception (self ):
1054+ async def test_taskgroup_cancel_after_exception (self ):
10551055 async def raise_exc (parent_tg : asyncio .TaskGroup ):
10561056 try :
10571057 raise RuntimeError
10581058 finally :
1059- parent_tg .stop ()
1059+ parent_tg .cancel ()
10601060
10611061 with self .assertRaises (ExceptionGroup ):
10621062 async with asyncio .TaskGroup () as tg :
0 commit comments