Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ repos:
- id: sort-simple-yaml
files: .pre-commit-config.yaml
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.5.1
rev: 26.10.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.9
rev: v0.17.0
hooks:
- id: ruff-check
types: [file]
Expand All @@ -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.50.3
rev: v1.51.1
hooks:
- id: typos
- repo: https://github.com/sphinx-contrib/sphinx-lint
Expand Down Expand Up @@ -69,7 +69,7 @@ repos:
additional_dependencies: ["pyyaml"]
files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.12.21
rev: 0.13.0
hooks:
# Compile requirements
- id: pip-compile
Expand Down
5 changes: 3 additions & 2 deletions src/trio/_core/_tests/test_thread_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
from .tutil import gc_collect_harder, slow

if TYPE_CHECKING:
from collections.abc import Iterator

from collections.abc import Generator

from outcome import Outcome

Expand Down Expand Up @@ -112,7 +113,7 @@ def test_idle_threads_exit(monkeypatch: pytest.MonkeyPatch) -> None:


@contextmanager
def _join_started_threads() -> Iterator[None]:
def _join_started_threads() -> Generator[None, None, None]:
before = frozenset(threading.enumerate())
try:
yield
Expand Down
10 changes: 6 additions & 4 deletions src/trio/_tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
)

if TYPE_CHECKING:
from collections.abc import AsyncIterator, Awaitable, Callable, Iterator
from collections.abc import AsyncGenerator, Awaitable, Callable, Generator

from trio._core import MockClock
from trio._ssl import T_Stream
Expand Down Expand Up @@ -158,7 +158,9 @@ def ssl_echo_serve_sync(
# (running in a thread). Useful for testing making connections with different
# SSLContexts.
@asynccontextmanager
async def ssl_echo_server_raw(expect_fail: bool = False) -> AsyncIterator[SocketStream]:
async def ssl_echo_server_raw(
expect_fail: bool = False,
) -> AsyncGenerator[SocketStream, None]:
a, b = stdlib_socket.socketpair()
async with trio.open_nursery() as nursery:
# Exiting the 'with a, b' context manager closes the sockets, which
Expand All @@ -179,7 +181,7 @@ async def ssl_echo_server_raw(expect_fail: bool = False) -> AsyncIterator[Socket
async def ssl_echo_server(
client_ctx: SSLContext,
expect_fail: bool = False,
) -> AsyncIterator[SSLStream[Stream]]:
) -> AsyncGenerator[SSLStream[Stream], None]:
async with ssl_echo_server_raw(expect_fail=expect_fail) as sock:
yield SSLStream(sock, client_ctx, server_hostname="trio-test-1.example.org")

Expand Down Expand Up @@ -368,7 +370,7 @@ async def do_test(
def virtual_ssl_echo_server(
client_ctx: SSLContext,
sleeper: Callable[[str], Awaitable[None]] | None = None,
) -> Iterator[SSLStream[PyOpenSSLEchoStream]]:
) -> Generator[SSLStream[PyOpenSSLEchoStream], None, None]:
fakesock = PyOpenSSLEchoStream(sleeper=sleeper)
yield SSLStream(fakesock, client_ctx, server_hostname="trio-test-1.example.org")

Expand Down
6 changes: 3 additions & 3 deletions src/trio/_tests/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import signal
import subprocess
import sys
from collections.abc import AsyncIterator, Callable
from collections.abc import AsyncGenerator, Callable
from contextlib import AbstractAsyncContextManager, asynccontextmanager
from functools import partial
from pathlib import Path as SyncPath
Expand Down Expand Up @@ -84,7 +84,7 @@ def SLEEP(seconds: int) -> list[str]:
async def open_process_then_kill( # type: ignore[misc, explicit-any]
*args: Any,
**kwargs: Any,
) -> AsyncIterator[Process]:
) -> AsyncGenerator[Process, None]:
proc = await open_process(*args, **kwargs)
try:
yield proc
Expand All @@ -97,7 +97,7 @@ async def open_process_then_kill( # type: ignore[misc, explicit-any]
async def run_process_in_nursery( # type: ignore[misc, explicit-any]
*args: Any,
**kwargs: Any,
) -> AsyncIterator[Process]:
) -> AsyncGenerator[Process, None]:
async with _core.open_nursery() as nursery:
kwargs.setdefault("check", False)
value = await nursery.start(partial(run_process, *args, **kwargs))
Expand Down
4 changes: 2 additions & 2 deletions src/trio/testing/_sequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .. import Event, _core, _util

if TYPE_CHECKING:
from collections.abc import AsyncIterator
from collections.abc import AsyncGenerator


@_util.final
Expand Down Expand Up @@ -62,7 +62,7 @@ async def main():
_broken: bool = attrs.field(default=False, init=False)

@asynccontextmanager
async def __call__(self, position: int) -> AsyncIterator[None]:
async def __call__(self, position: int) -> AsyncGenerator[None, None]:
if position in self._claimed:
raise RuntimeError(f"Attempted to reuse sequence point {position}")
if self._broken:
Expand Down
6 changes: 3 additions & 3 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ attrs==26.1.0
# outcome
babel==2.18.0
# via sphinx
black==26.5.1 ; implementation_name == 'cpython'
black==26.10.1 ; implementation_name == 'cpython'
# via -r test-requirements.in
certifi==2026.7.22
# via requests
Expand Down Expand Up @@ -143,7 +143,7 @@ requests==2.34.2
# via sphinx
roman-numerals==4.1.0 ; python_full_version >= '3.11'
# via sphinx
ruff==0.16.9
ruff==0.17.0
# via -r test-requirements.in
sniffio==1.3.1
# via -r test-requirements.in
Expand Down Expand Up @@ -205,7 +205,7 @@ typing-extensions==4.16.0
# virtualenv
urllib3==2.8.0
# via requests
uv==0.12.21
uv==0.13.0
# via -r test-requirements.in
virtualenv==21.14.1
# via pre-commit
Loading