
This patch set adds in a python coverage job for pegleg using pytest. Change-Id: Ice0332cc454f488e0372d5ab03e8b0a37db9efd1 Signed-off-by: Tin Lam <tin@irrational.io>
63 lines
1.4 KiB
INI
63 lines
1.4 KiB
INI
[tox]
|
|
envlist = py35, py36, pep8, docs, cover
|
|
minversion = 2.3.1
|
|
# Allows docs to be built without setup.py having to exist. Requires that
|
|
# usedevelop be False as well (which it is by default).
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
LANGUAGE=en_US
|
|
LC_ALL=en_US.utf-8
|
|
passenv = http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
basepython=python3
|
|
whitelist_externals =
|
|
find
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
{toxinidir}/tools/gate/run-unit-tests.sh '{posargs}'
|
|
|
|
[testenv:fmt]
|
|
basepython=python3
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
yapf --style=pep8 -ir {toxinidir}/pegleg {toxinidir}/tests
|
|
|
|
[testenv:pep8]
|
|
basepython=python3
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
flake8 {toxinidir}/pegleg
|
|
bandit -r pegleg -n 5
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
{toxinidir}/tools/gate/build-docs.sh
|
|
|
|
[testenv:bandit]
|
|
basepython=python3
|
|
commands = bandit -r pegleg -n 5
|
|
|
|
[testenv:cover]
|
|
basepython = python3
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
pytest --cov=pegleg --cov-report html:cover --cov-report xml:cover/coverage.xml --cov-report term --cov-fail-under 84 tests/
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[flake8]
|
|
ignore = E125,E251,W503
|