| 1 | commit 0df0045987436d9eef2c477ecc13ebea65205e1f
|
| 2 | Author: Nguyễn Gia Phong <[email protected]>
|
| 3 | Date: 2026-01-21 13:23:43 +0900
|
| 4 |
|
| 5 | Unuse exceptiongroup in test
|
| 6 |
|
| 7 | diff --git a/pyproject.toml b/pyproject.toml
|
| 8 | index dd1c0a3460a9..963da45d4ee8 100644
|
| 9 | |
| 10 | |
| 11 | @@ -48,7 +48,7 @@ pytest11 = {anyio = "anyio.pytest_plugin"}
|
| 12 | test = [
|
| 13 | "blockbuster >= 1.5.23",
|
| 14 | "coverage[toml] >= 7",
|
| 15 | - "exceptiongroup >= 1.2.0",
|
| 16 | + "exceptiongroup >= 1.2.0; python_version < '3.11'",
|
| 17 | "hypothesis >= 4.18.2",
|
| 18 | "psutil >= 5.9",
|
| 19 | "pytest >= 7.0",
|
| 20 | diff --git a/tests/test_taskgroups.py b/tests/test_taskgroups.py
|
| 21 | index b747f7291a4c..036ab9fcbeca 100644
|
| 22 | |
| 23 | |
| 24 | @@ -11,7 +11,6 @@ from typing import Any, NoReturn, cast
|
| 25 | from unittest import mock
|
| 26 |
|
| 27 | import pytest
|
| 28 | -from exceptiongroup import catch
|
| 29 | from pytest import FixtureRequest, MonkeyPatch
|
| 30 |
|
| 31 | import anyio
|
| 32 | @@ -1550,13 +1549,12 @@ async def test_cancel_before_entering_task_group() -> None:
|
| 33 |
|
| 34 |
|
| 35 | async def test_reraise_cancelled_in_excgroup() -> None:
|
| 36 | - def handler(excgrp: BaseExceptionGroup) -> None:
|
| 37 | - raise
|
| 38 | -
|
| 39 | with CancelScope() as scope:
|
| 40 | scope.cancel()
|
| 41 | - with catch({get_cancelled_exc_class(): handler}):
|
| 42 | + try:
|
| 43 | await anyio.sleep_forever()
|
| 44 | + except* get_cancelled_exc_class():
|
| 45 | + raise
|
| 46 |
|
| 47 |
|
| 48 | async def test_cancel_child_task_when_host_is_shielded() -> None:
|