From 67dee844f82e3e7335d451ca2fcc3e31521f4896 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 10 Dec 2020 10:27:31 +0000 Subject: [PATCH] use coverage directly instead of through pytest-cov plugin works better with parallel coverage --- .coveragerc | 1 - test_requirements.txt | 2 +- tox.ini | 12 ++++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.coveragerc b/.coveragerc index 5688fe4a..86d6290b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,7 +2,6 @@ # measure 'branch' coverage in addition to 'statement' coverage # See: http://coverage.readthedocs.org/en/coverage-4.0.3/branch.html#branch branch = True -parallel = True omit = tests/* # list of directories or packages to measure diff --git a/test_requirements.txt b/test_requirements.txt index 8a14f483..146b3e35 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,3 +1,3 @@ -r requirements.txt pytest>=4.5.0 -pytest-cov>=2.7 +coverage>=5 diff --git a/tox.ini b/tox.ini index e94a5a85..c0bab476 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,6 @@ -# More info on pytest-cov integration: https://pytest-cov.readthedocs.io/en/latest/tox.html -# Coverage is intentionally not appended to each run because we do not have a coverage -# service set up, it should be used by the developer for local runs only. - [tox] -envlist = lint, py{36,37}-cov, coverage-report +envlist = lint, py3{6,7,8,9}, coverage-report +skip_missing_interpreters = true [testenv] deps = @@ -11,7 +8,7 @@ deps = ; download the latest pip, setuptools and wheel when creating the venv download = true commands = - pytest --cov fontmake {posargs} + coverage run --parallel-mode -m pytest {posargs} [testenv:lint] skip_install = true @@ -23,4 +20,7 @@ commands = [testenv:coverage-report] skip_install = true commands = + coverage combine + coverage xml + coverage report coverage html