Use bandit block in tox.ini

Use the bandit testenv block in tox.ini instead of inlining
it. Also changed the call back to '-x tests' since that is
correct syntax, it was just broken in version 1.6.0, which
is now in the blacklist.

Change-Id: Id0bf1c6b1633ffb4143c7628b722434faf433d7d
This commit is contained in:
Brian Haley 2019-10-10 14:01:40 -04:00
parent 98448dce44
commit 65905cdb99
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ testtools>=2.2.0 # MIT
testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
doc8>=0.6.0 # Apache-2.0
bandit>=1.1.0 # Apache-2.0
bandit!=1.6.0,>=1.1.0 # Apache-2.0
tempest>=17.1.0 # Apache-2.0
# Required for pep8 - doc8 tests
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD

View File

@ -80,7 +80,7 @@ commands = flake8
doc/source octavia CONSTITUTION.rst HACKING.rst README.rst \
TESTING.rst
# Run security linter
bandit -r octavia -ll -ii -x 'octavia/tests/*'
{[testenv:bandit]commands}
# Make sure specs follow our template
find . -type f -name "*.pyc" -delete
python -m unittest specs-tests.test_titles
@ -151,7 +151,7 @@ commands =
[testenv:bandit]
basepython = python3
commands = bandit -r octavia -ll -ii -x octavia/tests {posargs}
commands = bandit -r octavia -ll -ii -x tests
[flake8]
# [H104]: Empty file with only comments