diff --git a/tests/test_taskgroups.py b/tests/test_taskgroups.py index 11329df..acef11f 100644 --- a/tests/test_taskgroups.py +++ b/tests/test_taskgroups.py @@ -8,7 +8,6 @@ from collections.abc import AsyncGenerator, Coroutine, Generator from typing import Any, NoReturn, cast import pytest -from exceptiongroup import catch import anyio from anyio import ( @@ -1330,8 +1329,10 @@ async def test_reraise_cancelled_in_excgroup() -> None: with CancelScope() as scope: scope.cancel() - with catch({get_cancelled_exc_class(): handler}): + try: await anyio.sleep_forever() + except* get_cancelled_exc_class() as excgrp: + handler(excgrp) async def test_cancel_child_task_when_host_is_shielded() -> None: