Add test environment configurations to support tox

Change-Id: I6c40cf28f9e860036c185a4e6faeb95018ae2fbe
This commit is contained in:
Jerry Xinyu Zhao 2014-02-08 02:40:12 +00:00
parent 1da12a51c1
commit edf7533b8c
4 changed files with 36 additions and 5 deletions

2
.gitignore vendored
View File

@ -28,7 +28,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
.testrepository
# Translations
*.mo

4
.testr.conf Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./compass/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -1,3 +1,4 @@
discover
mock
unittest2
testrepository>=0.0.17

34
tox.ini
View File

@ -1,10 +1,36 @@
[tox]
minversion = 1.6
envlist = py27
skipsdist = True
envlist = py26,py27,pep8
[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
{envpython} -m unittest discover
install_command = pip install -U {opts} {packages}
usedevelop = True
commands = python setup.py testr --slowest --testr-args='{posargs}'
distribute = false
[testenv:pep8]
commands = flake8
distribute = false
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[tox:jenkins]
downloadcache = ~/cache/pip
[flake8]
ignore = E126,H703
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools