[fix] resolve 16 mypy errors across 9 test files (make quality gate)

type-clean the test files so make quality (mypy roboco/ tests/) is green:
- Any-typed locals for the two TypeError-asserting scoping tests (bypass
  the required-arg check without getattr/ruff B009)
- Any-typed view for the shutdown-drain _drain_bg_tasks override (bypass
  mypy method-assign without setattr/ruff B010)
- cast("uuid.UUID", ...) / cast("UUID", ...) for SQLAlchemy UUID[Any]
  returns (TC006-quoted), config=None for AgentInstance stubs, None-narrowed
  await_args, Iterator return on a yielding fixture, UUID annotation on the
  _task helper. No type:ignore / noqa.
This commit is contained in:
Renn F
2026-06-29 02:33:09 +02:00
parent 041d0694d3
commit 592c84da5d
9 changed files with 44 additions and 20 deletions
@@ -86,8 +86,11 @@ async def test_close_pull_request_requires_project_id() -> None:
recorder: list[object] = []
svc = _service(recorder)
# Bind to an Any-typed local so mypy doesn't flag the missing project_id;
# the call still reaches the runtime, where it raises TypeError as asserted.
closer: Any = svc.close_pull_request
with pytest.raises(TypeError):
await svc.close_pull_request(_PR_NUMBER, comment="superseded") # no project_id
await closer(_PR_NUMBER, comment="superseded")
# The unscoped lookup was never issued — no SQL reached the session.
assert recorder == []