diff --git a/tests/canonical/conftest.py b/tests/canonical/conftest.py index f9c612dc1..539ed0389 100644 --- a/tests/canonical/conftest.py +++ b/tests/canonical/conftest.py @@ -1,9 +1,9 @@ """Pytest fixtures for the canonical acceptance harness. L0-a slice of #1170 — provides scenario discovery + per-scenario -fixture loading. The actual ``ouroboros_auto`` invocation lands -in a follow-up sub-PR; this PR ships the discovery contract, -fixture-shape validation, and the runner skeleton. +fixture loading. The live ``ouroboros_auto`` invocation is available +through the explicit ``OUROBOROS_RUN_CANONICAL=1`` opt-in path; the +default CI path remains hermetic and validates fixture shape. Per-scenario fixture is parametrized via ``pytest_generate_tests`` so adding a new ``tests/canonical//`` directory automatically diff --git a/tests/canonical/test_canonical.py b/tests/canonical/test_canonical.py index d23766fc2..adaab536d 100644 --- a/tests/canonical/test_canonical.py +++ b/tests/canonical/test_canonical.py @@ -22,6 +22,8 @@ import pytest +from ouroboros.core.types import Result + from .conftest import CanonicalScenario @@ -244,9 +246,9 @@ async def test_scenario_live_run_or_skip( result = await _invoke_ouroboros_auto(scenario, workdir) - assert result.is_ok(), ( + assert result.is_ok, ( f"{scenario.slug}: ouroboros_auto returned MCP error: " - f"{result.unwrap_err() if not result.is_ok() else 'unknown'}" + f"{result.error if result.is_err else 'unknown'}" ) tool_result = result.unwrap() @@ -279,16 +281,6 @@ async def test_live_run_opt_in_invokes_auto_handler( calls: list[tuple[str, Path]] = [] - class _Ok: - def is_ok(self) -> bool: - return True - - def unwrap(self) -> object: - return _ToolResult() - - def unwrap_err(self) -> str: - return "unexpected" - class _ToolResult: is_error = False content: list[object] = [] @@ -298,9 +290,9 @@ class _ToolResult: "product_status": "verified_complete", } - async def fake_invoke(selected: CanonicalScenario, workdir: Path) -> _Ok: + async def fake_invoke(selected: CanonicalScenario, workdir: Path) -> Result[object, str]: calls.append((selected.slug, workdir)) - return _Ok() + return Result.ok(_ToolResult()) monkeypatch.setattr( "tests.canonical.test_canonical._invoke_ouroboros_auto",