Testing Python

package testing


the lowest common denominator

While I am not defending the state of python packaging, I do maintain that it's probably better to work with what exists than yet-another-fork-of-distutils. I reserve the right to change my mind.

In any case, setup.py does has some goodies that may make unification of testing easier.

setup.py has test-related keywords: see the documentation:

The way that setup.py wants you to test is:

python setup.py test


When tox first became the next cool thing, I mostly didn't like it: it seemed like just another widget that folks threw in their github project so that we could all safely say that we moved on past the reative deficiency of what's in the cython standard library. As often, however, my first-blush opinion was wrong. tox as described in its documentation is great for managing virtualenvs for testing, which is something I do fully support: it is better to manage boilerplate setup than to try to manage teardown (citation needed, I know). You'll want to test that your dependency set is accurate. You'll want to test that your package works with multiple interpreters.