[tox]
skip_missing_interpreters = true
envlist =
    py{37,38,39,310},
    coverage

[testenv]
use_develop = true
deps =
    -r{toxinidir}/requirements-dev.txt
    # setup.py has unpinned dependencies by default
    !unpinned: -r{toxinidir}/requirements-dev.txt
setenv =
    COVERAGE_FILE = tests/.coverage.{envname}
    PYTHONDONTWRITEBYTECODE=1
passenv = TOXENV CI CODECOV_* SYSTEM_* AGENT_* BUILD_*
commands =
    pytest {toxinidir}/tests {toxinidir}/flaskbb {posargs}

[testenv:coverage]
skip_install = true
deps = coverage
setenv =
    COVERAGE_FILE = tests/.coverage
commands =
    coverage combine
    coverage report

[testenv:coverage-ci]
skip_install = true
deps = codecov
setenv =
    COVERAGE_FILE = tests/.coverage
commands =
    coverage combine
    coverage xml
    coverage report
    codecov
