1
0

[loop-cycle-7] fix: Configure mypy with explicit-package-bases for proper src/ layout (#1346) (#1359)

This commit is contained in:
2026-03-24 09:39:12 +00:00
parent 91d06eeb49
commit 002ace5b3c
6 changed files with 37 additions and 10 deletions

View File

@@ -1,7 +1,6 @@
from unittest.mock import MagicMock, patch
from unittest.mock import patch
import pytest
from scripts.llm_triage import (
get_context,
get_prompt,
@@ -9,6 +8,7 @@ from scripts.llm_triage import (
run_triage,
)
# ── Mocks ──────────────────────────────────────────────────────────────────
@pytest.fixture
def mock_files(tmp_path):

View File

@@ -10,8 +10,9 @@ Covers the public API and internal helpers not exercised in other test files:
- Disabled-engine guard for every mutating method
"""
from unittest.mock import MagicMock, patch
import pytest
from unittest.mock import patch, MagicMock
@pytest.fixture(autouse=True)
@@ -128,11 +129,10 @@ class TestGetSparkEngineSingleton:
mock_settings = MagicMock()
mock_settings.spark_enabled = False
with patch("spark.engine.settings", mock_settings, create=True):
from spark.engine import get_spark_engine, reset_spark_engine
from spark.engine import reset_spark_engine
reset_spark_engine()
# Patch at import time by mocking the config module in engine
import spark.engine as engine_module
original_func = engine_module.get_spark_engine
def patched_get():
global _spark_engine
@@ -181,8 +181,8 @@ class TestModuleLevelGetattr:
class TestOnTaskPostedWithoutCandidates:
def test_no_eidos_prediction_when_no_candidates(self):
"""When candidate_agents is empty, no EIDOS prediction should be stored."""
from spark.engine import SparkEngine
from spark.eidos import get_predictions
from spark.engine import SparkEngine
engine = SparkEngine(enabled=True)
eid = engine.on_task_posted("t1", "Background task", candidate_agents=[])
@@ -208,6 +208,7 @@ class TestOnTaskCompletedWithBid:
def test_winning_bid_stored_in_data(self):
"""winning_bid is serialised into the event data field."""
import json
from spark.engine import SparkEngine
from spark.memory import get_events
@@ -220,6 +221,7 @@ class TestOnTaskCompletedWithBid:
def test_without_winning_bid_is_none(self):
import json
from spark.engine import SparkEngine
from spark.memory import get_events

View File

@@ -10,7 +10,6 @@ from __future__ import annotations
import ast
import math
import subprocess
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest