Tutorials #
Two independent ways to learn Litmus — pick the one that fits how you want to start. They are not a sequence: the Quick Start is not "step 0" of the step-by-step path.
Quick Start #
litmus init quick_start --starter scaffolds a complete project — part spec, station, fixture, a test, and config — that passes pytest immediately with mock instruments. Best when you want to see the whole thing working first, then read the walkthrough to understand each piece.
pip install litmus-test
litmus init quick_start --starter && cd quick_start
pytestStep-by-step tutorial #
Start from nothing — a bare conftest.py with one mock fixture — and add a single concept per step, up to a production-ready, fully traceable suite with live monitoring. Best when you want to learn each piece as you introduce it; each step builds on the previous one.
| Step | Goal | What You'll Learn |
|---|---|---|
| 1. First Test | Run something | pytest, project structure |
| 2. Running Without Hardware | Use mock mode | --mock-instruments, mock_config (station-config block of canned return values used when --mock-instruments is on) |
| 3. pytest-native tests | Log measurements | the core per-test Litmus fixtures — context is the ambient run/UUT/station/vector state (always available; carries sweep params when present, observations always), verify records the measurement row AND raises on FAIL, measure records the row without raising (plus ~17 other public fixtures the plugin exposes — see litmus-fixtures) |
| 4. Add Limits | Pass/fail criteria | Limit, Measurement, Outcome |
| 5. Test Configuration | Configure in YAML | sidecar (YAML next to a test file carrying vectors and limits) |
| 6. Part Specifications | Define parts | parts/*.yaml, characteristics |
| 7. Real Instruments | Talk to hardware | stations/*.yaml, VISA, simulation |
| 8. Capability Matching | Find compatible stations | direction flip, matching API |
| 9. Production Ready | Full traceability | fixtures, test classes, sidecar |
| 10. Live Monitoring | Monitor in real time | sessions, events, channels |
| 11. Waveforms and Evidence | Capture a scope waveform and judge derived scalars | three verbs, observe, ChannelStore |
| 12. Continuous Monitoring | Stream live DMM data from an interactive session into the operator UI | three verbs, channels.stream, interactive connect |
Prerequisites #
- Python 3.11 or later
- Basic familiarity with pytest
- Litmus installed (
pip install litmus-test)
Time Commitment #
Each step takes 10-15 minutes. You can complete the entire tutorial in about 2 hours, or work through it over several sessions.
What You'll Build #
By the end of this tutorial, you'll have:
- A working test suite for a voltage converter
- YAML-based configuration for limits and test parameters
- Tests that run with real instruments OR in simulation mode
- Automatic station matching based on required capabilities
- Full traceability from requirements to results
- Live monitoring of test sessions with event queries
Ready? #
- See it working now → Quick Start
- Learn it from the ground up → Step 1: First Test