From 57a27a770c825a2f62bff1cf48987c72dadf2624 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Thu, 12 May 2022 15:41:38 -0500 Subject: [PATCH] Add code coverage reports --- .gitignore | 2 ++ tox.ini | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9a522db..993327a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ *.egg-info *.pyc +.coverage* .idea/ .tox/ .venv/ build/ dist/ +htmlcov/ diff --git a/tox.ini b/tox.ini index 752a2bd..b70643d 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,9 @@ ; On Windows, only CPython >= 3.8 is supported. ; All older versions, and PyPy, lack full symlink support. envlist = + coverage_erase py{38, 39, 310}-all_platforms + coverage_report py{27, 35, 36, 37}-most_platforms pypy{2, 3}-most_platforms py39-black @@ -20,9 +22,30 @@ deps = pytest-randomly pyyaml mock; python_version == "2.7" + all_platforms: coverage commands = - pytest tests/ + all_platforms: coverage run -m pytest + most_platforms: pytest tests/ + + +[testenv:coverage_erase] +skipsdist = true +skip_install = true +deps = coverage +commands = coverage erase + + +[testenv:coverage_report] +skipsdist = true +skip_install = true +deps = coverage +commands_pre = + coverage combine + +commands = + coverage report + coverage html [testenv:py39-black] @@ -43,3 +66,15 @@ deps = commands = isort --check dotbot/ tests/ + + +[coverage:run] +branch = true +parallel = true +source = + dotbot/ + tests/ + + +[coverage:html] +directory = htmlcov