mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
[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:
@@ -12,6 +12,7 @@ reaper's live-skip and the spawn gate see the live agent immediately.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
@@ -20,7 +21,7 @@ from roboco.runtime.orchestrator import AgentOrchestrator, AgentState
|
||||
_EXPECTED_READOPTED = 2
|
||||
|
||||
|
||||
def _orch() -> AgentOrchestrator:
|
||||
def _orch() -> Any:
|
||||
orch = AgentOrchestrator.__new__(AgentOrchestrator) # bypass __init__
|
||||
orch._instances = {}
|
||||
return orch
|
||||
@@ -35,7 +36,7 @@ async def test_readopts_running_containers_as_active() -> None:
|
||||
slug = name.removeprefix("roboco-agent-")
|
||||
return (slug in running, 0)
|
||||
|
||||
orch._inspect_container_state = AsyncMock(side_effect=inspect) # type: ignore[method-assign]
|
||||
orch._inspect_container_state = AsyncMock(side_effect=inspect)
|
||||
|
||||
n = await orch._readopt_running_agents()
|
||||
|
||||
@@ -51,7 +52,7 @@ async def test_readopt_leaves_already_tracked_instance_untouched() -> None:
|
||||
orch = _orch()
|
||||
sentinel = MagicMock()
|
||||
orch._instances = {"be-dev-1": sentinel}
|
||||
orch._inspect_container_state = AsyncMock(return_value=(True, 0)) # type: ignore[method-assign]
|
||||
orch._inspect_container_state = AsyncMock(return_value=(True, 0))
|
||||
|
||||
await orch._readopt_running_agents()
|
||||
|
||||
@@ -61,7 +62,7 @@ async def test_readopt_leaves_already_tracked_instance_untouched() -> None:
|
||||
@pytest.mark.asyncio
|
||||
async def test_readopt_inert_when_nothing_running() -> None:
|
||||
orch = _orch()
|
||||
orch._inspect_container_state = AsyncMock(return_value=(False, None)) # type: ignore[method-assign]
|
||||
orch._inspect_container_state = AsyncMock(return_value=(False, None))
|
||||
|
||||
n = await orch._readopt_running_agents()
|
||||
|
||||
@@ -72,7 +73,7 @@ async def test_readopt_inert_when_nothing_running() -> None:
|
||||
@pytest.mark.asyncio
|
||||
async def test_readopt_swallows_probe_errors() -> None:
|
||||
orch = _orch()
|
||||
orch._inspect_container_state = AsyncMock(side_effect=RuntimeError("no docker")) # type: ignore[method-assign]
|
||||
orch._inspect_container_state = AsyncMock(side_effect=RuntimeError("no docker"))
|
||||
|
||||
n = await orch._readopt_running_agents()
|
||||
|
||||
@@ -87,8 +88,8 @@ async def test_readopt_records_container_id_so_health_check_can_see_exit() -> No
|
||||
# is stranded under a phantom ACTIVE instance forever. Re-adopt must capture
|
||||
# the real container id so the health loop can observe the later exit.
|
||||
orch = _orch()
|
||||
orch._inspect_container_state = AsyncMock(return_value=(True, 0)) # type: ignore[method-assign]
|
||||
orch._resolve_container_id = AsyncMock(return_value="deadbeef1234") # type: ignore[method-assign]
|
||||
orch._inspect_container_state = AsyncMock(return_value=(True, 0))
|
||||
orch._resolve_container_id = AsyncMock(return_value="deadbeef1234")
|
||||
|
||||
await orch._readopt_running_agents()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user