diff --git a/.gitignore b/.gitignore index 0fd5d763..20814ea6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,17 @@ -*.egg-info -*.pyc +# Distribution / packaging +build/ +dist/ +*.egg-info/ + +# Unit test / coverage reports __pycache__ +htmlcov/ +.tox/ .coverage .coverage.* durations/* coverage*.xml -dist -htmlcov -test +qcfg.json # IDEs .vscode/ @@ -23,23 +27,9 @@ venv/ # Mac personalization files *.DS_Store -# Tox envs -.tox - -# Backup files and folders -*.bkp -*.bkp.* -*bkp* - -# Build output -/build/lib/ - # Generated by setuptools_scm /fms_mo/_version.py -# Generated by tests -qcfg.json - # Generated by spelling check dictionary.dic diff --git a/tox.ini b/tox.ini index c99019f7..6312515f 100644 --- a/tox.ini +++ b/tox.ini @@ -3,15 +3,18 @@ envlist = ruff, lint, spellcheck, unit minversion = 4.4 [testenv] -description = run tests (unit) +description = run tests (unit, unitcov) extras = dev package = wheel wheel_build_env = pkg deps = pytest + pytest-cov + pytest-html commands = - unit: {basepython} -m pytest {posargs:tests} + unit: {envpython} -m pytest {posargs:tests} + unitcov: {envpython} -W error::UserWarning -m pytest --cov=fms_mo --cov-report term --cov-report=html:coverage-{env_name} --cov-report=xml:coverage-{env_name}.xml --html=durations/{env_name}.html {posargs:tests -m "not (examples or slow)"} [testenv:py3] basepython = python3.11 @@ -19,6 +22,9 @@ basepython = python3.11 [testenv:unit] basepython = {[testenv:py3]basepython} +[testenv:unitcov] +basepython = {[testenv:py3]basepython} + [testenv:lint] description = lint with pylint basepython = {[testenv:py3]basepython} @@ -68,23 +74,8 @@ commands = {envpython} -m pyspelling --config {toxinidir}/.spellcheck.yml --spellchecker aspell allowlist_externals = sh -[testenv:coverage] -description = report unit test coverage -deps = - coverage - pytest - genbadge[coverage] -commands = - coverage run \ - --omit=*/_version.py \ - --source=fms_mo \ - --module pytest tests/ - coverage report -m - coverage xml - genbadge coverage -s -i coverage.xml - [gh] python = - 3.11 = 3.11 - 3.10 = 3.10 - 3.9 = 3.9 + 3.11 = 3.11-{unitcov} + 3.10 = 3.10-{unitcov} + 3.9 = 3.9-{unitcov}