##############################################################################
# Intended to simplify local generation of coverage of Cython files
#
# tox -e cython-coverage
#
# will produce a HTML report showing line-by-line coverage
#
# can be used to run standard tests on Python 2.7, 3.5, 3.6, and 3.7 or a
# run with coverage but without coverage of Cython files using
#
# tox -e ENV
#
# where env is one of the values in envlist or all environments (slow)
#
# tox
#
##############################################################################
[tox]
envlist = 
    py37
    py38
    py39
    coverage
    cython-coverage

[testenv]
deps =
    -rrequirements.txt
    cython
    matplotlib
    joblib
    pytest>=6
    pytest-xdist
setenv =
    MKL_NUM_THREADS=1
    NUMEXPR_NUM_THREADS=1
    OMP_NUM_THREADS=1
    OPENBLAS_NUM_THREADS=1
changedir = {homedir}
commands =
    python -c "import statsmodels;statsmodels.test(['-n 2'], exit=True)"

[testenv:coverage]
usedevelop = True
deps =
    {[testenv]deps}
    pytest-cov
setenv =
    {[testenv]setenv}
    SM_CYTHON_COVERAGE=false
changedir = {toxinidir}
commands =
    coverage erase
    pytest -n 2 --cov-report html --cov=statsmodels statsmodels

[testenv:cython-coverage]
usedevelop = True
deps =
    {[testenv]deps}
    pytest-cov
setenv =
    {[testenv]setenv}
    SM_CYTHON_COVERAGE=true
changedir = {toxinidir}
commands =
    coverage erase
    pytest -n 2 --cov-report html --cov=statsmodels statsmodels
