CHAPTER 8

Testing

bestPy comes with an extensive suite of almost 500 tests to make sure all components of the software work as ecxpected, alone and together. These tests can be found in the tests subdirectory, mirroring the directory structure of the modules they test.

The easiest way to run these tests is to change into the parent directory of the bestPy package (wherever it is located) and execute

python -m unittest

on the command line. For a more verbose output, run

python -m unittest -v

instead. Of course, tests will only run if all required dependencies are installed, as specified in the enivironment.yml file.

When runing the more verbose version, you will see that some tests are skipped because they Could not connect to the test database. Indeed, this test database (necessary to test reading from postgreSQL) is not part of the bestPy distribution.

Finally, if you start hacking bestPy to implement you own readers, datastructures, and algorithms make it a habbit to write tests ever so slightly ahead of what you actually code (Greetings from Uncle Bob)!


In [ ]: