diff --git a/test-requirements.txt b/test-requirements.txt index b269977..f17f5ef 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,3 +11,6 @@ oslotest>=1.5.1 # Apache-2.0 oslosphinx>=2.5.0 # Apache-2.0 sphinxcontrib-pecanwsme>=0.8 sphinxcontrib-httpdomain +mock +flake8 +unittest diff --git a/tox.ini b/tox.ini index b9352bc..d0e3c89 100644 --- a/tox.ini +++ b/tox.ini @@ -1,46 +1,34 @@ [tox] -envlist = py27,py33,py34,pep8 +envlist = py27,py34,linters minversion = 1.6 skipsdist = True [testenv] -sitepackages = True -usedevelop = True -install_command = pip install -U --force-reinstall {opts} {packages} setenv = VIRTUAL_ENV={envdir} - PYTHONDONTWRITEBYTECODE = 1 + NOSE_WITH_OPENSTACK=1 + NOSE_OPENSTACK_COLOR=1 + NOSE_OPENSTACK_RED=0.05 + NOSE_OPENSTACK_YELLOW=0.025 + NOSE_OPENSTACK_SHOW_ELAPSED=1 + NOSE_OPENSTACK_STDOUT=1 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - python -m mistral.openstack.common.lockutils python setup.py test --slowest --testr-args='{posargs}' -whitelist_externals = rm + /usr/bin/find . -type f -name "*.pyc" -delete + nosetests -v {posargs} +whitelist_externals = * -[testenv:pep8] +[testenv:linters] commands = flake8 {posargs} -[testenv:cover] -# Also do not run test_coverage_ext tests while gathering coverage as those -# tests conflict with coverage. -setenv = VIRTUAL_ENV={envdir} -commands = - python setup.py testr --coverage \ - --testr-args='^(?!.*test.*coverage).*$' - [testenv:venv] commands = {posargs} -[testenv:docs] -commands = - rm -rf doc/html doc/build - rm -rf doc/source/apidoc doc/source/api - python setup.py build_sphinx - -[testenv:pylint] -setenv = VIRTUAL_ENV={envdir} -commands = bash tools/lintstack.sh +[testenv:linters] +commands = flake8 +distribute = false [flake8] +ignore = H703,H102,E265,E262,H233 show-source = true -ignore = H803,H305,H405 -builtins = _ -exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,scripts +exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build,setup.py,tests/ci/*,scripts/*