Tox is a great project that makes testing against different python versions simple, standing on the shoulders of pip and virtualenv.  For our project the tox specification is incredibly simple:
$ cat tox.ini 
[tox]
envlist = py27, py34
[testenv]
commands = nosetests -v
deps =
    nose
    -rrequirements.txt
This tells tox to create two virtualenv's, one for python 2.7 and one for python 3.4, install dependencies listed in requirements.txt, and then run tests with "nosetests -v".  You can run the test against all of the configured environments with just
tox
Or a particular subset like this:
tox -e py34
 
No comments:
Post a Comment