[tox]
envlist =
    init,
    py26,
    py27,
    py35,
    py36,
    py37,
    report,

[testenv]
usedevelop = True
deps =
    -r{toxinidir}/dev_requirements.txt
    -r{toxinidir}/tests/ansible/requirements.txt

commands =
    {posargs:bash run_tests}
whitelist_externals =
    bash
setenv =
    NOCOVERAGE_ERASE = 1
    NOCOVERAGE_REPORT = 1

[testenv:init]
commands =
    coverage erase
deps =
    coverage

[testenv:report]
commands =
    coverage html
    echo "coverage report is at file://{toxinidir}/htmlcov/index.html"
deps =
    coverage
whitelist_externals =
    echo

[testenv:docs]
basepython = python
changedir = docs
commands =
    sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
