[chore] remove all remaining type:ignore suppressions from tests/

Converts 115 `# type: ignore[...]` suppressions across 23 test files to
no-suppression patterns (helper-return widening to Any, local Any aliases,
cc:Any aliases, cast at narrow call sites, typed fixtures) so the hard
no-type:ignore convention holds across tests/. No test logic or assertions
changed — only mock-wiring mechanics and type annotations.

Gate: ruff check tests/ clean; mypy tests/ (538 files) clean; 176 changed-file
tests pass. Zero real suppressions remain (the 7 grep hits are 3 hygiene-
checker string-literal test inputs and 4 prose mentions in comments).
This commit is contained in:
Renn F
2026-06-28 17:00:20 +02:00
parent 4d4bf084c5
commit f826285651
23 changed files with 177 additions and 175 deletions
@@ -15,7 +15,7 @@ import pytest
from roboco.services.gateway.choreographer import Choreographer, ChoreographerDeps
def _make_choreographer(git: AsyncMock) -> Choreographer:
def _make_choreographer(git: AsyncMock) -> Any:
base: dict[str, Any] = {
"task": AsyncMock(),
"work_session": AsyncMock(),
@@ -25,9 +25,9 @@ def _make_choreographer(git: AsyncMock) -> Choreographer:
"audit": AsyncMock(),
"evidence_repo": AsyncMock(),
}
c = Choreographer(ChoreographerDeps(**base))
c: Any = Choreographer(ChoreographerDeps(**base))
# _project_slug_for hits the project service; stub it for the unit.
c._project_slug_for = AsyncMock(return_value="proj") # type: ignore[method-assign]
c._project_slug_for = AsyncMock(return_value="proj")
return c
@@ -32,7 +32,7 @@ from roboco.foundation.policy import lifecycle as spec_module
from roboco.services.gateway.choreographer import Choreographer, ChoreographerDeps
def _make_choreographer() -> Choreographer:
def _make_choreographer() -> Any:
base: dict[str, Any] = {
"task": AsyncMock(),
"work_session": AsyncMock(),
@@ -45,12 +45,12 @@ def _make_choreographer() -> Choreographer:
return Choreographer(ChoreographerDeps(**base))
def _stub_post_path(c: Choreographer, *, reviewer_id: Any, t: Any) -> None:
def _stub_post_path(c: Any, *, reviewer_id: Any, t: Any) -> None:
"""Drive ``post_pr_review`` past preflight + the verdict-consistency gate so
the hand-format guard is the thing under test. The runner / side-effects are
stubbed so a passing case does not hit GitHub or the DB transition."""
agent = MagicMock(role="pr_reviewer", slug="be-pr-reviewer")
c._post_pr_review_preflight = AsyncMock( # type: ignore[method-assign]
c._post_pr_review_preflight = AsyncMock(
return_value=(
agent,
"pr_reviewer",
@@ -58,13 +58,13 @@ def _stub_post_path(c: Choreographer, *, reviewer_id: Any, t: Any) -> None:
spec_module.Context(actor_id=reviewer_id),
)
)
c._verdict_consistency_gate = AsyncMock(return_value=None) # type: ignore[method-assign]
c._project_slug_for = AsyncMock(return_value="proj") # type: ignore[method-assign]
c._resolve_post_body = MagicMock(return_value="generated body") # type: ignore[method-assign]
c._verdict_consistency_gate = AsyncMock(return_value=None)
c._project_slug_for = AsyncMock(return_value="proj")
c._resolve_post_body = MagicMock(return_value="generated body")
runner = MagicMock()
runner.run_intent = AsyncMock(return_value=t)
c._verb_runner = MagicMock(return_value=runner) # type: ignore[method-assign]
c._post_review_side_effects = AsyncMock() # type: ignore[method-assign]
c._verb_runner = MagicMock(return_value=runner)
c._post_review_side_effects = AsyncMock()
def _task() -> Any: