fix(toolchain): type-annotate test helpers for the full mypy gate

make quality runs mypy over tests/ too; the toolchain test fixtures
(monkeypatch params, the fake-subprocess factories) were missing annotations.
No behavior change.
This commit is contained in:
Renn F
2026-06-22 01:59:41 +02:00
parent 78c6981089
commit 7d50405ccb
4 changed files with 29 additions and 12 deletions
@@ -19,6 +19,7 @@ from roboco.services.workspace import (
)
if TYPE_CHECKING:
from collections.abc import Callable
from pathlib import Path
_PY = '[project]\nname = "x"\nrequires-python = ">=3.14,<3.15"\n'
@@ -50,8 +51,10 @@ def test_detect_dep_commands_no_python_is_unchanged(tmp_path: Path) -> None:
assert commands[0][1] == ["uv", "sync", "--extra", "dev"]
def _fake_run_factory(captured: list[list[str]], *, collect_rc: int):
def _fake_run(argv, **_kw) -> subprocess.CompletedProcess[str]:
def _fake_run_factory(
captured: list[list[str]], *, collect_rc: int
) -> Callable[..., subprocess.CompletedProcess[str]]:
def _fake_run(argv: list[str], **_kw: object) -> subprocess.CompletedProcess[str]:
captured.append(argv)
rc = collect_rc if "--collect-only" in argv else 0
return subprocess.CompletedProcess(argv, returncode=rc, stdout="", stderr="")