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: |
Testing on the Instrument, Testing Over the Network, Testing Devices That Share a Computer |
experiment |
Testing an Experiment: |
a run on the real devices |
analyzer |
Testing an Analyzer: |
— |
viewer |
— |
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 |
|---|---|
the standard test of a device module, against a simulated instrument |
|
smaller tools for testing parameters, operations, shared instruments and parameter files |
|
checking an experiment’s plan without instruments |
|
checking an analyzer on generated inputs |
|
checking plots without a window |
|
checking a device on its real instrument, with timings and failure statistics |
|
the same, through a client, the network and the device’s server |
|
whether devices on one computer slow each other down |
|
the stand-ins for hardware these tests use |