monasca-notification/tox.ini
Craig Bryant ef9db22744 Turn on bandit check as part of pep8
Add bandit job as part of pep8 in tox.ini

Had to mark two instances of try except pass as OK so that bandit
will pass

Change-Id: If3b78e9dcbfc65c232a6ba35665430a6463841e6
2017-02-07 12:13:12 -07:00

83 lines
2.0 KiB
INI

[tox]
envlist = {py27,py35,pypy}-{mysql,postgres},pep8,cover
minversion = 2.1
skipsdist = True
[testenv]
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=tests
CLIENT_NAME=monasca-notification
passenv = http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
usedevelop = True
install_command =
{toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} --pre
whitelist_externals = bash
find
rm
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
PyMySQL>=0.6.1
commands =
find . -type f -name "*.pyc" -delete
ostestr {posargs}
[testenv:py27-postgres]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
psycopg2>=2.5
[testenv:py35-postgres]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
psycopg2>=2.5
[testenv:pypy-postgres]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
psycopg2>=2.5
[testenv:cover]
basepython = python2.7
deps = {[testenv]deps}
commands =
{[testenv]commands}
coverage erase
python setup.py test --coverage --testr-args='{posargs}' --coverage-package-name=monasca_notification
coverage report
[testenv:debug]
commands =
oslo_debug_helper -t ./monasca_notification/tests {posargs}
[testenv:pep8]
deps =
{[testenv]deps}
commands =
{[testenv:flake8]commands}
{[bandit]commands}
[testenv:venv]
commands = {posargs}
[testenv:flake8]
commands =
flake8 monasca_notification
[flake8]
max-line-length = 120
# TODO: ignored checks should be enabled in the future
# H201 no 'except:' at least use 'except Exception:'
# H405 multi line docstring summary not separated with an empty line
ignore = F821,H201,H405
exclude=.venv,.git,.tox,dist,*egg,build
[bandit]
commands =
bandit -r monasca_notification -n5 -x monasca_notification/tests