mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
Splitting the role in smaller parts helps to keep the overview and to develop separate tests.
143 lines
2.8 KiB
INI
143 lines
2.8 KiB
INI
[tox]
|
|
envlist = black, flake8, pylint, py{26,27,36,37}, ensure_non_running_provider
|
|
skipsdist = true
|
|
skip_missing_interpreters = True
|
|
|
|
[testenv]
|
|
basepython = python2.7
|
|
deps =
|
|
py{26,27,36,37}: pytest-cov
|
|
py{27,36,37}: pytest>=3.5.1
|
|
py{26,27}: mock
|
|
py26: pytest
|
|
|
|
[base]
|
|
passenv = *
|
|
setenv =
|
|
PYTHONPATH = {toxinidir}/library:{toxinidir}/module_utils
|
|
LC_ALL = C
|
|
changedir = {toxinidir}/tests
|
|
covtarget = {toxinidir}/library --cov {toxinidir}/module_utils
|
|
pytesttarget = .
|
|
|
|
[testenv:black]
|
|
basepython = python3.6
|
|
deps = black
|
|
|
|
commands = black --check --diff --include "^[^.].*\.py$" .
|
|
|
|
[testenv:py26]
|
|
passenv = {[base]passenv}
|
|
setenv =
|
|
{[base]setenv}
|
|
changedir = {[base]changedir}
|
|
basepython = python2.6
|
|
commands =
|
|
pytest \
|
|
--durations=5 \
|
|
--cov={[base]covtarget} \
|
|
--cov-report=html:htmlcov-py26 --cov-report=term \
|
|
{posargs} \
|
|
{[base]pytesttarget}
|
|
|
|
[testenv:py27]
|
|
passenv = {[base]passenv}
|
|
setenv =
|
|
{[base]setenv}
|
|
changedir = {[base]changedir}
|
|
basepython = python2.7
|
|
commands =
|
|
pytest \
|
|
--durations=5 \
|
|
--cov={[base]covtarget} \
|
|
--cov-report=html:htmlcov-py27 --cov-report=term \
|
|
{posargs} \
|
|
{[base]pytesttarget}
|
|
|
|
[testenv:py36]
|
|
passenv = {[base]passenv}
|
|
setenv =
|
|
{[base]setenv}
|
|
changedir = {[base]changedir}
|
|
basepython = python3.6
|
|
commands =
|
|
pytest \
|
|
--durations=5 \
|
|
--cov={[base]covtarget} \
|
|
--cov-report=html:htmlcov-py36 --cov-report=term \
|
|
{posargs} \
|
|
{[base]pytesttarget}
|
|
|
|
[testenv:py37]
|
|
passenv = {[base]passenv}
|
|
setenv =
|
|
{[base]setenv}
|
|
changedir = {[base]changedir}
|
|
basepython = python3.7
|
|
commands =
|
|
pytest \
|
|
--durations=5 \
|
|
--cov={[base]covtarget} \
|
|
--cov-report=html:htmlcov-py37 --cov-report=term \
|
|
{posargs} \
|
|
{[base]pytesttarget}
|
|
|
|
[testenv:pylint]
|
|
basepython = python2.7
|
|
setenv =
|
|
{[base]setenv}
|
|
deps =
|
|
pylint>=1.8.4
|
|
ansible
|
|
commands =
|
|
pylint \
|
|
--errors-only \
|
|
{posargs} \
|
|
library/network_connections.py \
|
|
module_utils/network_lsr \
|
|
tests/test_network_connections.py
|
|
|
|
[testenv:flake8]
|
|
deps =
|
|
flake8>=3.5
|
|
whitelist_externals = flake8
|
|
commands=
|
|
flake8 --statistics {posargs} \
|
|
.
|
|
|
|
[testenv:coveralls]
|
|
passenv = TRAVIS TRAVIS_*
|
|
deps =
|
|
coveralls
|
|
changedir = {[base]changedir}
|
|
commands =
|
|
coveralls
|
|
|
|
[testenv:ensure_non_running_provider]
|
|
basepython = python3.6
|
|
deps =
|
|
PyYAML
|
|
changedir = {toxinidir}/tests
|
|
commands = {toxinidir}/tests/ensure_non_running_provider.py
|
|
|
|
[pytest]
|
|
addopts = -rxs
|
|
|
|
[flake8]
|
|
show_source = True
|
|
max-line-length = 88
|
|
ignore = E402,W503
|
|
|
|
[pylint]
|
|
max-line-length = 88
|
|
disable = wrong-import-position
|
|
|
|
[pycodestyle]
|
|
max-line-length = 88
|
|
|
|
[travis]
|
|
python =
|
|
2.6: py26
|
|
2.7: py27,coveralls,flake8,pylint
|
|
3.6: py36,black,ensure_non_running_provider
|
|
3.7: py37
|