diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8ebe14..183c352 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,4 @@ jobs: - name: Lint with ruff run: ruff check src/ tests/ - name: Run tests + run: python -m pytest tests/ -v --tb=short diff --git a/tests/test_ci_workflow.py b/tests/test_ci_workflow.py new file mode 100644 index 0000000..50c88be --- /dev/null +++ b/tests/test_ci_workflow.py @@ -0,0 +1,17 @@ +import yaml +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] + + +def test_ci_test_step_executes_full_suite(): + workflow = yaml.safe_load( + (ROOT / ".github" / "workflows" / "ci.yml").read_text(encoding="utf-8") + ) + test_steps = workflow["jobs"]["test"]["steps"] + run_tests = next( + (step for step in test_steps if step.get("name") == "Run tests"), + None, + ) + assert run_tests is not None, "CI test job must include a 'Run tests' step" + assert run_tests.get("run") == "python -m pytest tests/ -v --tb=short"