Unit Testing#

This project uses the Python pytest 1 package to apply unit testing 2 to the source code. The test code is in the tests/ directories. Various tests have been developed starting to provide features or resolve problems reported.

The unit tests are implemented in a standard manner such that independent review 3 can run the tests on this code based on the instructions provided in .github/workflows configuration files in the project directory.

This command will run the unit tests locally:

pytest -vvv .

Additional information may be learned with a Python package to run the tests:

coverage run -m pytest --lf -vvv .

The coverage command (4), will run the tests and create a report of the percentage of the Python source code that has been executed during the unit tests:

coverage report --precision 3

The unit tests on GitHub automatically upload the coverage results to the coveralls 5 site 6 which tracks coverage over time.

1

Python pytest package: https://pytest.org

2

unit testing: https://en.wikipedia.org/wiki/Unit_testing

3

GitHub Actions workflow: https://github.com/prjemian/spec2nexus/actions

4

coverage: https://coverage.readthedocs.io

5

coveralls: https://coveralls.io

6

coveralls code coverage: https://coveralls.io/github/prjemian/spec2nexus