1
0

fix: resolve 23 ruff lint errors

Fixes #1149
This commit is contained in:
Alexander Whitestone
2026-03-23 14:51:57 -04:00
parent 3a8d9ee380
commit 4e4206a91e
22 changed files with 116 additions and 124 deletions

View File

@@ -25,7 +25,6 @@ from timmy.backlog_triage import (
score_issue,
)
# ── Fixtures ─────────────────────────────────────────────────────────────────

View File

@@ -7,7 +7,6 @@ Refs: #1073
"""
import json
from io import BytesIO
from unittest.mock import MagicMock, patch
import pytest
@@ -79,7 +78,9 @@ def test_get_memory_info_handles_subprocess_failure(monitor):
@pytest.mark.asyncio
async def test_check_memory_ok(monitor):
with patch.object(monitor, "_get_memory_info", return_value={"free_gb": 20.0, "total_gb": 64.0}):
with patch.object(
monitor, "_get_memory_info", return_value={"free_gb": 20.0, "total_gb": 64.0}
):
result = await monitor._check_memory()
assert result.name == "memory"
@@ -126,7 +127,7 @@ async def test_check_memory_exception_returns_unknown(monitor):
@pytest.mark.asyncio
async def test_check_disk_ok(monitor):
usage = MagicMock()
usage.free = 100 * (1024**3) # 100 GB
usage.free = 100 * (1024**3) # 100 GB
usage.total = 500 * (1024**3) # 500 GB
usage.used = 400 * (1024**3)
@@ -140,7 +141,7 @@ async def test_check_disk_ok(monitor):
@pytest.mark.asyncio
async def test_check_disk_low_triggers_cleanup(monitor):
usage = MagicMock()
usage.free = 5 * (1024**3) # 5 GB — below threshold
usage.free = 5 * (1024**3) # 5 GB — below threshold
usage.total = 500 * (1024**3)
usage.used = 495 * (1024**3)
@@ -176,12 +177,8 @@ async def test_check_disk_critical_when_cleanup_fails(monitor):
def test_get_ollama_status_reachable(monitor):
tags_body = json.dumps({
"models": [{"name": "qwen3:30b"}, {"name": "llama3.1:8b"}]
}).encode()
ps_body = json.dumps({
"models": [{"name": "qwen3:30b", "size": 1000}]
}).encode()
tags_body = json.dumps({"models": [{"name": "qwen3:30b"}, {"name": "llama3.1:8b"}]}).encode()
ps_body = json.dumps({"models": [{"name": "qwen3:30b", "size": 1000}]}).encode()
responses = [
_FakeHTTPResponse(tags_body),

View File

@@ -6,7 +6,6 @@ import pytest
from timmy.vassal.agent_health import AgentHealthReport, AgentStatus
# ---------------------------------------------------------------------------
# AgentStatus
# ---------------------------------------------------------------------------
@@ -49,9 +48,7 @@ def test_report_any_stuck():
def test_report_all_idle():
report = AgentHealthReport(
agents=[AgentStatus(agent="claude"), AgentStatus(agent="kimi")]
)
report = AgentHealthReport(agents=[AgentStatus(agent="claude"), AgentStatus(agent="kimi")])
assert report.all_idle is True

View File

@@ -6,14 +6,12 @@ import pytest
from timmy.vassal.backlog import (
AgentTarget,
TriagedIssue,
_choose_agent,
_extract_labels,
_score_priority,
triage_issues,
)
# ---------------------------------------------------------------------------
# _extract_labels
# ---------------------------------------------------------------------------

View File

@@ -12,7 +12,6 @@ from timmy.vassal.house_health import (
_probe_disk,
)
# ---------------------------------------------------------------------------
# Data model tests
# ---------------------------------------------------------------------------

View File

@@ -6,7 +6,6 @@ import pytest
from timmy.vassal.orchestration_loop import VassalCycleRecord, VassalOrchestrator
# ---------------------------------------------------------------------------
# VassalCycleRecord
# ---------------------------------------------------------------------------
@@ -134,6 +133,6 @@ def test_orchestrator_stop_when_not_running():
def test_module_singleton_exists():
from timmy.vassal import vassal_orchestrator, VassalOrchestrator
from timmy.vassal import VassalOrchestrator, vassal_orchestrator
assert isinstance(vassal_orchestrator, VassalOrchestrator)