Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/canonical/conftest.py
Original file line number Diff line number Diff line change
@@ -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/<slug>/`` directory automatically
Expand Down
20 changes: 6 additions & 14 deletions tests/canonical/test_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import pytest

from ouroboros.core.types import Result

from .conftest import CanonicalScenario


Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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] = []
Expand All @@ -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",
Expand Down