27 lines
936 B
Python
27 lines
936 B
Python
"""Shared pytest boundaries for repository automation tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _patched_hermes_cli_db_contract(request, monkeypatch):
|
|
"""Keep legacy lane test doubles focused on their original safety boundary."""
|
|
module_name = request.module.__name__.rsplit(".", 1)[-1]
|
|
if not module_name.startswith("test_hermes_cli_") or module_name.endswith(
|
|
"capabilities"
|
|
):
|
|
return
|
|
capability_module = sys.modules.get("cli_lane_capabilities")
|
|
if capability_module is None:
|
|
return
|
|
safe = capability_module.KanbanCapabilities(True, True, True)
|
|
for name, module in tuple(sys.modules.items()):
|
|
if (
|
|
name == "cli_lane_runner" or name.startswith("cli_lane_")
|
|
) and hasattr(module, "kanban_capabilities"):
|
|
monkeypatch.setattr(module, "kanban_capabilities", lambda _db: safe)
|