Add tox config.

Add a config file for tox to enable running salt tests in a set of
virtualenvs for different versions of python. Add stanzas to allow
for running tests against 2.6, 2.7 and 3.2.

First step - pip install tox. Then, to run tests in a virtualenv
against all three, simply type:

tox

If you want to  run against just one, try:

tox -epy26

And if you want to see more, do:

tox -v -epy26
This commit is contained in:
Monty Taylor 2012-04-19 11:15:25 -07:00
parent c720526932
commit 12fd1315f8
3 changed files with 15 additions and 1 deletions

2
.gitignore vendored
View file

@ -17,3 +17,5 @@ lib/
pip/
share/
# tox - ignore any tox-created virtualenv dirs
.tox

View file

@ -14,7 +14,7 @@ from distutils.sysconfig import get_python_lib, PREFIX
if os.environ.get('VIRTUAL_ENV'):
from setuptools import setup
execfile('salt/version.py')
exec(compile(open("salt/version.py").read(), "salt/version.py", 'exec'))
class TestCommand(Command):
description = 'Run tests'

12
tox.ini Normal file
View file

@ -0,0 +1,12 @@
[tox]
envlist = py26,py27,py32
[testenv]
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
unittest2
commands = bash -c 'cd tests && python runtests.py'
[testenv:py32]
basepython = python3.2
deps = -r{toxinidir}/requirements.txt