From d038db8a505aa31a1c78072d382ed3b3cda738a0 Mon Sep 17 00:00:00 2001 From: Endre Karlson Date: Thu, 23 May 2013 23:23:57 +0200 Subject: [PATCH] Switch to flake8 and testr Change-Id: Ia25ef86786895f376be410f74b9a30e3e8ff4243 --- .gitignore | 1 + .testr.conf | 4 ++++ tools/test-requires | 3 +++ tox.ini | 50 ++++++++++++++++++++------------------------- 4 files changed, 30 insertions(+), 28 deletions(-) create mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 3f8253d..5430ee8 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ doc/source/api/* doc/build/* dist monikerclient/versioninfo +.testrepository diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..08b650b --- /dev/null +++ b/.testr.conf @@ -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 diff --git a/tools/test-requires b/tools/test-requires index daf9e63..c728a45 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -1,4 +1,7 @@ +flake8 nose mox openstack.nose_plugin +python-subunit sphinx +testrepository diff --git a/tox.ini b/tox.ini index 66819e1..0b75652 100644 --- a/tox.ini +++ b/tox.ini @@ -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