patrole/tox.ini
Felipe Monteiro 4bf66a2285 Hacking: enable extensions H106, H203 and H904
[H106] Don't put vim configuration in source files.
[H203] Use assertIs(Not)None to check for None.
[H904] Delay string interpolations at logging calls.

This change makes Patrole's hacking consistent with
Tempest's [0][1].

[0] https://review.openstack.org/#/c/408211/
[1] https://review.openstack.org/#/c/408066/

Change-Id: Ia56f66b4ab7e1eea6a8bfea05bf52865be13430c
2017-05-17 15:36:16 +00:00

65 lines
1.9 KiB
INI

[tox]
minversion = 1.6
envlist = pep8,py35,py27
skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH OS_TEST_PATH http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
whitelist_externals = find
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete
ostestr {posargs} --whitelist-file test-whitelist.txt
[testenv:pep8]
commands = flake8 {posargs}
check-uuid --package patrole_tempest_plugin.tests.api
[testenv:uuidgen]
commands = check-uuid --package patrole_tempest_plugin.tests.api --fix
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands = rm -rf *.pyc
rm -rf cover
rm -f .coverage
nosetests {posargs}
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_COVERAGE=1
NOSE_COVER_BRANCHES=1
NOSE_COVER_PACKAGE=patrole_tempest_plugin
NOSE_COVER_HTML=1
NOSE_COVER_HTML_DIR={toxinidir}/cover
NOSE_WHERE=patrole_tempest_plugin/tests/unit
whitelist_externals = nosetests
rm
[testenv:docs]
commands = python setup.py build_sphinx
[testenv:releasenotes]
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:debug]
commands = oslo_debug_helper -t patrole_tempest_plugin/tests {posargs}
[flake8]
enable-extensions = H106,H203,H904
show-source = True
# E123, E125 skipped as they are invalid PEP-8.
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
local-check-factory = patrole_tempest_plugin.hacking.checks.factory