Switch to flake8 and testr

Change-Id: Ia25ef86786895f376be410f74b9a30e3e8ff4243
This commit is contained in:
Endre Karlson 2013-05-23 23:23:57 +02:00
parent e853efb11d
commit d038db8a50
4 changed files with 30 additions and 28 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ doc/source/api/*
doc/build/*
dist
monikerclient/versioninfo
.testrepository

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 ./ ./monikerclient/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -1,4 +1,7 @@
flake8
nose
mox
openstack.nose_plugin
python-subunit
sphinx
testrepository

50
tox.ini
View File

@ -1,39 +1,33 @@
[tox]
envlist = py26,py27,pep8,pyflakes
envlist = py26,py27,pep8
minversion = 1.4.0
[testenv]
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
deps = -r{toxinidir}/tools/setup-requires
-r{toxinidir}/tools/pip-requires
-r{toxinidir}/tools/test-requires
commands =
python setup.py testr --testr-args='{posargs}'
sitepackages = False
[tox:jenkins]
downloadcache = ~/cache/pip
[testenv]
deps = -r{toxinidir}/tools/setup-requires
-r{toxinidir}/tools/pip-requires
-r{toxinidir}/tools/test-requires
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
NOSE_OPENSTACK_YELLOW=0.025
NOSE_OPENSTACK_SHOW_ELAPSED=1
commands = nosetests {posargs}
sitepackages = False
[testenv:pep8]
commands = flake8
[testenv:cover]
deps = {[testenv]deps}
coverage
nosexcover
setenv = {[testenv]setenv}
NOSE_WITH_COVERAGE=1
[testenv:pep8]
deps = {[testenv]deps}
pep8==1.3.3
commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack monikerclient setup.py bin/moniker
[testenv:pyflakes]
deps = {[testenv]deps}
pyflakes==0.5.0
commands = pyflakes monikerclient bin setup.py
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:venv]
commands = {posargs}
[flake8]
ignore = E12,E711,E721,E712,F,H302
show-source = True
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools