Tests - gugarosa/nalp GitHub Wiki

If you ever wanted to check in depth our code, it is also interesting to run some tests. This will allow you to check whether everything is right on track or not.

PyTest

The first method that we offer is running solo the pytest command. This will realize all the implemented tests and return an output declaring whether they passed or failed.

pytest tests/

Coverage

An interesting addition to the solo pytest is the coverage module. Despite offering the same outputs from pytest, it will also offer a report that documents how much percent of the code is covered by the tests. Note that we, from NALP, usually uses this method.

coverage run -m pytest tests/

coverage report -m