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
pytest

Quick Start walkthrough →

Step-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.

StepGoalWhat You'll Learn
1. First TestRun somethingpytest, project structure
2. Running Without HardwareUse mock mode--mock-instruments, mock_config (station-config block of canned return values used when --mock-instruments is on)
3. pytest-native testsLog measurementsthe core per-test Litmus fixturescontext 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 LimitsPass/fail criteriaLimit, Measurement, Outcome
5. Test ConfigurationConfigure in YAMLsidecar (YAML next to a test file carrying vectors and limits)
6. Part SpecificationsDefine partsparts/*.yaml, characteristics
7. Real InstrumentsTalk to hardwarestations/*.yaml, VISA, simulation
8. Capability MatchingFind compatible stationsdirection flip, matching API
9. Production ReadyFull traceabilityfixtures, test classes, sidecar
10. Live MonitoringMonitor in real timesessions, events, channels
11. Waveforms and EvidenceCapture a scope waveform and judge derived scalarsthree verbs, observe, ChannelStore
12. Continuous MonitoringStream live DMM data from an interactive session into the operator UIthree 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:

  1. A working test suite for a voltage converter
  2. YAML-based configuration for limits and test parameters
  3. Tests that run with real instruments OR in simulation mode
  4. Automatic station matching based on required capabilities
  5. Full traceability from requirements to results
  6. Live monitoring of test sessions with event queries

Ready? #