[tox]
envlist =
    clean

    py37
    py38
    py39
    py310

    coverage_report

isolated_build = True

[coverage:paths]
source =
    .
    .tox/*/site-packages

[testenv:clean]
deps = coverage
skip_install = true
setenv = COVERAGE_FILE=.coverage
changedir = {toxinidir}
commands = coverage erase

[testenv]
# This is necessary to make sure we are importing the installed
# code, not the code from the project directory
changedir = tests

setenv = COVERAGE_FILE={toxinidir}/tests/.coverage.{envname}

deps =
    pytest
    coverage

commands =
    coverage run --source introspection --branch -m pytest .

[testenv:coverage_report]
deps = coverage
skip_install = true
setenv = COVERAGE_FILE=.coverage
changedir = {toxinidir}
commands =
    coverage combine tests
    coverage html
