# Testing plesty-lib ships ready-made tests, in `plesty.lib.test`, that a module runs on itself. They check what every module of its kind must get right, so a module does not have to write those tests itself. None of them imports pytest: a failure raises `AssertionError`, which fails a pytest test and can equally be run from a plain script next to the instrument. ## Which tests each module runs | Module | Without the instrument | With the instrument | |---|---|---| | device | [Testing a Device](device.md): `DevicePipeline`, checked by gate `d1` | [Testing on the Instrument](field_test.md), [Testing Over the Network](client_field_test.md), [Testing Devices That Share a Computer](concurrency.md) | | experiment | [Testing an Experiment](experiment.md): `ExperimentPipeline`, checked by gate `e1` | a run on the real devices | | analyzer | [Testing an Analyzer](analyzer.md): `AnalyzerPipeline`, checked by gate `a1` | — | | viewer | [Testing a Viewer](viewer.md) | — | A **gate** is one of the checks that `plesty check`, the checking command of plesty-sdk (PLESTY's developer tool), runs before a module may be published. Gates `d1`, `e1` and `a1` look for the tests above in the module and run them. The tests without the instrument run anywhere, including in CI on every push. The tests with the instrument are kept out of CI and run next to the hardware. ## In this chapter | Page | Covers | |---|---| | [Testing a Device](device.md) | the standard test of a device module, against a simulated instrument | | [Device Test Helpers](device_helpers.md) | smaller tools for testing parameters, operations, shared instruments and parameter files | | [Testing an Experiment](experiment.md) | checking an experiment's plan without instruments | | [Testing an Analyzer](analyzer.md) | checking an analyzer on generated inputs | | [Testing a Viewer](viewer.md) | checking plots without a window | | [Testing on the Instrument](field_test.md) | checking a device on its real instrument, with timings and failure statistics | | [Testing Over the Network](client_field_test.md) | the same, through a client, the network and the device's server | | [Testing Devices That Share a Computer](concurrency.md) | whether devices on one computer slow each other down | | [Simulation](sim.md) | the stand-ins for hardware these tests use |