[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
@@ -9,7 +9,7 @@ from __future__ import annotations
import asyncio
from pathlib import Path
from types import SimpleNamespace
from typing import Any
from typing import TYPE_CHECKING, Any
from unittest.mock import patch
from uuid import UUID
@@ -20,6 +20,9 @@ from roboco.runtime.orchestrator import (
)
from roboco.services import prompter_live
if TYPE_CHECKING:
from collections.abc import Iterator
def _make_orchestrator() -> AgentOrchestrator:
"""AgentOrchestrator with constructor I/O skipped; a RUNNING minimal one."""
@@ -97,7 +100,7 @@ def _wire_secretary_spawn_mocks(
@pytest.fixture(autouse=True)
def _fresh_registry() -> None:
def _fresh_registry() -> Iterator[None]:
"""Isolate the process-wide live registry per test."""
prev = prompter_live._RegistryHolder.instance
prompter_live._RegistryHolder.instance = prompter_live.PrompterLiveRegistry()