check:features gate
This Story turns pytest-bdd feature files into CI-checked contracts instead of prose that can silently drift away from Python step bindings.
The mental model: the feature file is a hearing transcript, and the step module is the sworn witness list. The gate fails when the transcript names a witness nobody can call, when someone marks the hearing as work-in-progress, or when a skipped answer tries to count as testimony.
What changed
scripts/check_features.pyscans required features for@wip.- The same script runs
pytest --generate-missing --feature tests/features tests/stepsso unbound scenarios and undefined steps fail before the full suite. - It then executes
tests/stepsand rejects skipped, xfailed, or xpassed BDD outcomes. - CI runs the new named
check:featuresstep before the normal full test suite.
Proof fixture
tests/feature_gate_fixtures/ contains a deliberately incomplete feature binding outside the required suite. The unit proof runs the gate against that non-required path and asserts it exits non-zero with pytest-bdd's missing-step message.
python scripts/check_features.py \
--features tests/feature_gate_fixtures \
--steps tests/feature_gate_fixtures/missing_step_probe.py
How to verify
python scripts/check_features.pypasses for the required BDD suite.- The proof command above fails on the deliberate missing step.
pytest tests/and Ruff on the new Python files stay green.