test: meta gates for architecture, CI, docs and packaging

This commit is contained in:
smillmorel 2026-09-16 12:03:07 -04:00
commit ff09e38b7c
5 changed files with 388 additions and 0 deletions

View file

@ -0,0 +1,29 @@
"""Meta-gates tying the test markers to the CI commands that consume them."""
from __future__ import annotations
from pathlib import Path
try:
import tomllib
except ModuleNotFoundError: # Python < 3.11
import tomli as tomllib
ROOT = Path(__file__).resolve().parents[2]
PYPROJECT = ROOT / "pyproject.toml"
CI = ROOT / ".github" / "workflows" / "ci.yml"
HEADLESS_COMMAND = 'pytest tests/unit tests/services -m "not slow"'
def test_slow_marker_is_declared() -> None:
"""``[tool.pytest.ini_options]`` registers the ``slow`` marker."""
with PYPROJECT.open("rb") as handle:
config = tomllib.load(handle)
markers = config["tool"]["pytest"]["ini_options"]["markers"]
assert any(marker.startswith("slow:") for marker in markers), markers
def test_ci_runs_the_headless_command() -> None:
"""The headless CI command matches the marker the suite expects."""
assert HEADLESS_COMMAND in CI.read_text(encoding="utf-8")