mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
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:
@@ -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="")
|
||||
|
||||
Reference in New Issue
Block a user