Tests
Rules
After every change to the code:
Go to the directory
{OBSINFOROOT}/testsand runpytest
Before any deployment:
go to the directory
{OBSINFOROOT}/src/obsinfo/testsand runpytestverify that all of the instructions in the tutorial work
Explanation
{OBSINFOROOT}/testscontains quick unit tests{OBSINFOROOT}/src/obsinfo/testsruns theschema,printand ``plotcommands on everyexampleandtemplatefileRunning the tutorial also verifies that the
setupcommand works and that the examples provide the expected output
Coding recommendations
We implement testing using the unittest Unit testing framework
(https://docs.python.org/3/library/unittest.html).
Unit tests are quick verifications of individual coding
units. They should run quickly (< 1 second/test).
Each test_*.py file in the {OBSINFOROOT}/tests directory
corresponds to a single class or code file.
If you write a new function or method, write a unittest for it in
{OBSINFOROOT}/tests, either in an existing file or in a new one.
If you discover a bug that is not covered by a test, write a unittest for it in
{OBSINFOROOT}/tests.