| """Pytest configuration.""" | |
| from __future__ import annotations | |
| import sys | |
| from pathlib import Path | |
| import pytest | |
| ROOT = Path(__file__).resolve().parent.parent | |
| if str(ROOT) not in sys.path: | |
| sys.path.insert(0, str(ROOT)) | |
| def fixed_structure(monkeypatch): | |
| """Pin structural rotation off so assertions can name one exact rewrite. | |
| Production picks a different valid structure per request. Tests that cover | |
| that behaviour opt back in with the ``structural_variation`` fixture. | |
| """ | |
| from app.engine import orchestrator | |
| monkeypatch.setattr(orchestrator, "ENGINE_STRUCTURAL_VARIATION", False) | |
| def structural_variation(monkeypatch): | |
| from app.engine import orchestrator | |
| monkeypatch.setattr(orchestrator, "ENGINE_STRUCTURAL_VARIATION", True) | |