Testing¶

Unit tests can be found in the tests directory. Most unit tests for functions/classes exist in the form of doctests under the Examples section of their respective docstrings.

This project uses pytest to collect and run tests, and tox to setup, manage and teardown virtualenvs to ensure the package installs correctly with different Python versions and interpreters.

pytest has been configured to collect and run unit tests and doctests together by simply running

$ py.test

from the root of the project (same level as setup.cfg). Alternatively, you can also run setup.py with the test subcommand, as we have integrated pytest with setuptools.

$ python setup.py test

To test the package with different Python versions and interpreters, simply run

$ tox

from the root of the project (same level as tox.ini), which will run python setup.py test under the various virtual environments it creates.