From b08940be4cbdefc845306cad2de367258f34f2ac Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 21:37:30 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.15 → v0.15.16](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.15...v0.15.16) - [github.com/adhtruong/mirrors-typos: v1.47.0 → v1.47.2](https://github.com/adhtruong/mirrors-typos/compare/v1.47.0...v1.47.2) - [github.com/astral-sh/uv-pre-commit: 0.11.17 → 0.11.19](https://github.com/astral-sh/uv-pre-commit/compare/0.11.17...0.11.19) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84391ca22..11b7a4d54 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.15 + rev: v0.15.16 hooks: - id: ruff-check types: [file] @@ -38,7 +38,7 @@ repos: # tomli needed on 3.10. tomllib is available in stdlib on 3.11+ - tomli - repo: https://github.com/adhtruong/mirrors-typos - rev: v1.47.0 + rev: v1.47.2 hooks: - id: typos - repo: https://github.com/sphinx-contrib/sphinx-lint @@ -73,7 +73,7 @@ repos: additional_dependencies: ["pyyaml"] files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$ - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.11.17 + rev: 0.11.19 hooks: # Compile requirements - id: pip-compile From 7b71fb0127c3597052182a8a5f405a3d964a24aa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 21:37:49 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- test-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 648ee0488..8165628e0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -143,7 +143,7 @@ requests==2.34.2 # via sphinx roman-numerals==4.1.0 ; python_full_version >= '3.11' # via sphinx -ruff==0.15.15 +ruff==0.15.16 # via -r test-requirements.in sniffio==1.3.1 # via -r test-requirements.in @@ -205,7 +205,7 @@ typing-extensions==4.15.0 # virtualenv urllib3==2.7.0 # via requests -uv==0.11.17 +uv==0.11.19 # via -r test-requirements.in virtualenv==21.4.2 # via pre-commit From 9b3d632947de4919a4624e1c9cf5564b58acc0e8 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Tue, 9 Jun 2026 02:42:20 -0400 Subject: [PATCH 3/3] Add a bunch of noqas --- src/trio/_core/_tests/test_asyncgen.py | 8 +++++--- src/trio/_tests/test_channel.py | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/trio/_core/_tests/test_asyncgen.py b/src/trio/_core/_tests/test_asyncgen.py index f9c190d49..7250b1f04 100644 --- a/src/trio/_core/_tests/test_asyncgen.py +++ b/src/trio/_core/_tests/test_asyncgen.py @@ -22,7 +22,8 @@ def test_asyncgen_basics() -> None: async def example(cause: str) -> AsyncGenerator[int, None]: try: with contextlib.suppress(GeneratorExit): - yield 42 + # we *want* to test what happens to delayed `await` + yield 42 # noqa: ASYNC119 await _core.checkpoint() except _core.Cancelled: assert "exhausted" not in cause @@ -277,14 +278,15 @@ async def test_fallback_when_no_hook_claims_it( async def well_behaved() -> AsyncGenerator[int, None]: yield 42 + # noqas because we *want* to test delayed yield/await! async def yields_after_yield() -> AsyncGenerator[int, None]: with pytest.raises(GeneratorExit): - yield 42 + yield 42 # noqa: ASYNC119 yield 100 async def awaits_after_yield() -> AsyncGenerator[int, None]: with pytest.raises(GeneratorExit): - yield 42 + yield 42 # noqa: ASYNC119 await _core.cancel_shielded_checkpoint() with restore_unraisablehook(): diff --git a/src/trio/_tests/test_channel.py b/src/trio/_tests/test_channel.py index c8b2efddc..fc72b704e 100644 --- a/src/trio/_tests/test_channel.py +++ b/src/trio/_tests/test_channel.py @@ -559,7 +559,7 @@ async def agen() -> AsyncGenerator[None]: yield with trio.CancelScope() as cscope: cscope.cancel() - yield + yield # noqa: ASYNC119 # https://github.com/astral-sh/ruff/issues/25770 with pytest.raises(AssertionError): async with agen() as recv_chan: @@ -636,7 +636,7 @@ async def test_as_safe_channel_genexit_exception_group() -> None: async def agen() -> AsyncGenerator[None]: try: async with trio.open_nursery(): - yield + yield # noqa: ASYNC119 # https://github.com/astral-sh/ruff/issues/25770 except BaseException as e: assert pytest.RaisesGroup(GeneratorExit).matches(e) # noqa: PT017 raise @@ -668,7 +668,7 @@ async def wait_then_raise() -> None: async def agen() -> AsyncGenerator[None]: async with trio.open_nursery() as nursery: nursery.start_soon(wait_then_raise) - yield + yield # noqa: ASYNC119 # https://github.com/astral-sh/ruff/issues/25770 with pytest.RaisesGroup(ValueError): async with agen() as g: @@ -688,7 +688,7 @@ async def agen(ex: type[BaseException]) -> AsyncGenerator[None]: async with trio.open_nursery() as nursery: nursery.start_soon(wait_then_raise, ex) nursery.start_soon(wait_then_raise, GeneratorExit) - yield + yield # noqa: ASYNC119 # https://github.com/astral-sh/ruff/issues/25770 with pytest.RaisesGroup(AssertionError): async with agen(GeneratorExit) as g: