Tutorial: Engineer's First Project #

Welcome to Litmus! This tutorial takes you from your first test to a production-ready test suite. Each step builds on the previous one, introducing one concept at a time.

Learning Path #

StepGoalWhat You'll Learn
0. Quick StartSmallest end-to-end loopinstall, run, see results
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/DUT/station/vector state (always available; carries sweep params when present, observations always), verify records the measurement row AND raises on FAIL, logger.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. Product SpecificationsDefine productsproducts/*.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

Prerequisites #

  • Python 3.11 or later
  • Basic familiarity with pytest
  • Litmus installed (uv sync or pip install -e .)

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

Quick Start #

If you just want to see working code:

litmus init quick_start --starter && cd quick_start
pytest

Then come back here to understand how it works.

Ready? #

Start with Step 1: First Test →