A pure-pytest hardware test procedure for TofuPilot -- zero imports from us. Each test function is a phase, and the recognized assert shapes are promoted to measurements on the dashboard automatically.
| Feature | Where |
|---|---|
| Numeric closed-range measurement | test_supply_voltage (assert 4.8 <= voltage <= 5.2) |
| Numeric single-bound measurement | test_response_time (assert latency < 200) |
pytest.approx(value, abs=tol) mapped to a centered range |
test_voltage_approx |
| String equality measurement | test_serial_number_format |
| String membership in a literal tuple | test_led_color |
| Boolean equality measurement | test_power_good_flag (assert power_good == True) |
| Multiple measurements in one phase (distinct identifiers) | test_supply_rail_pair (voltage + current) |
| Stacked validators on one measurement (same identifier) | test_supply_voltage_layered_limits (outer guardrail + nominal bounds) |
| Parametrized phase (each variant is its own row) | test_rail_within_5pct |
Description and unit come from the assert message -- assert <expr>, "Description [unit]". Brackets around the unit are optional; both fields are optional.
- Sign up for a free TofuPilot account at tofupilot.app.
- Open the New Procedure flow in the dashboard and clone this template.
- Follow the dashboard's instructions to set up a station and run the procedure.
When deployed via TofuPilot, runs are captured automatically -- no output callback or station server is needed. The TofuPilot dashboard provides the operator UI and renders measurements with their validators.
For deeper guides, see the TofuPilot docs.
uv run pytest
.
├── test_pcb.py # Pytest tests, one phase per `test_*` function
├── pyproject.toml # Python dependencies (uv)
├── uv.lock
└── README.md
