@@ -2145,14 +2145,14 @@ async def taskfunc(x: int, y: int) -> int:
21452145
21462146 assert re .match (
21472147 r"<TaskHandle pending "
2148- r"name='TestCreateTask.test_return_value.<locals>.taskfunc' "
2148+ r"name='tests.test_taskgroups. TestCreateTask.test_return_value.<locals>.taskfunc' "
21492149 r"coro=<coroutine object(.+)>>" ,
21502150 repr (handle ),
21512151 )
21522152 assert await handle == 6
21532153 assert re .match (
21542154 r"<TaskHandle finished "
2155- r"name='TestCreateTask.test_return_value.<locals>.taskfunc' "
2155+ r"name='tests.test_taskgroups. TestCreateTask.test_return_value.<locals>.taskfunc' "
21562156 r"coro=<coroutine object(.+)>>" ,
21572157 repr (handle ),
21582158 )
@@ -2179,7 +2179,7 @@ async def taskfunc() -> NoReturn:
21792179
21802180 assert re .match (
21812181 r"<TaskHandle failed "
2182- r"name='TestCreateTask.test_exception.<locals>.taskfunc' "
2182+ r"name='tests.test_taskgroups. TestCreateTask.test_exception.<locals>.taskfunc' "
21832183 r"coro=<coroutine object(.+)>" ,
21842184 repr (handle ),
21852185 )
@@ -2202,7 +2202,7 @@ async def main() -> None:
22022202 assert handle .status is TaskHandle .Status .FAILED
22032203 assert re .match (
22042204 r"<TaskHandle failed "
2205- r"name='TestCreateTask.test_base_exception.<locals>.taskfunc' "
2205+ r"name='tests.test_taskgroups. TestCreateTask.test_base_exception.<locals>.taskfunc' "
22062206 r"coro=<coroutine object(.+)>" ,
22072207 repr (handle ),
22082208 )
@@ -2237,7 +2237,7 @@ async def taskfunc() -> None:
22372237 assert handle .status is TaskHandle .Status .CANCELLING
22382238 assert re .match (
22392239 r"<TaskHandle cancelling "
2240- r"name='TestCreateTask.test_cancel.<locals>.taskfunc' "
2240+ r"name='tests.test_taskgroups. TestCreateTask.test_cancel.<locals>.taskfunc' "
22412241 r"coro=<coroutine object(.+)>>" ,
22422242 repr (handle ),
22432243 )
@@ -2259,7 +2259,7 @@ async def taskfunc() -> None:
22592259 assert task_started
22602260 assert re .match (
22612261 r"<TaskHandle cancelled "
2262- r"name='TestCreateTask.test_cancel.<locals>.taskfunc' "
2262+ r"name='tests.test_taskgroups. TestCreateTask.test_cancel.<locals>.taskfunc' "
22632263 r"coro=<coroutine object(.+)>>" ,
22642264 repr (handle ),
22652265 )
@@ -2284,13 +2284,16 @@ async def taskfunc() -> str | None:
22842284 handle = tg .create_task (taskfunc ())
22852285 assert re .match (
22862286 r"<TaskHandle pending "
2287- r"name='TestCreateTask.test_task_name_default.<locals>.taskfunc' "
2287+ r"name='tests.test_taskgroups. TestCreateTask.test_task_name_default.<locals>.taskfunc' "
22882288 r"coro=<coroutine object(.+)>>" ,
22892289 repr (handle ),
22902290 )
22912291 assert await handle == handle .name
22922292
2293- assert handle .name == "TestCreateTask.test_task_name_default.<locals>.taskfunc"
2293+ assert (
2294+ handle .name
2295+ == "tests.test_taskgroups.TestCreateTask.test_task_name_default.<locals>.taskfunc"
2296+ )
22942297
22952298 async def test_task_name_custom_name (self ) -> None :
22962299 async def taskfunc () -> None :
@@ -2326,11 +2329,7 @@ async def genfunc(x: int, y: int) -> AsyncGenerator[int, None]:
23262329
23272330 async with create_task_group () as tg :
23282331 async with aclosing (genfunc (3 , 5 )) as g :
2329- if create_task :
2330- handle = tg .create_task (g .asend (None ))
2331- assert handle .name .startswith ("<async_generator_asend object at " )
2332- else :
2333- handle = tg .start_soon (g .asend , None )
2334- assert handle .name == "async_generator.asend"
2332+ handle = tg .start_soon (g .asend , None )
2333+ assert handle .name == "async_generator.asend"
23352334
23362335 assert await handle == 8
0 commit comments