diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1da4339..59754dc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,9 @@ jobs: tox -e mypy - name: Test with tox run: | + coverage erase tox + coverage combine coverage xml - uses: codecov/codecov-action@v3 with: diff --git a/pyproject.toml b/pyproject.toml index d172820..f1ad627 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,12 +72,19 @@ show_contexts = true [tool.coverage.run] branch = true -include =[ - "src/pytest_bdd/*", - "tests/*", -] +# `parallel` will cause each tox env to put data into a different file, so that we can combine them later +parallel = true +source = ["pytest_bdd", "tests"] dynamic_context = "test_function" +[tool.coverage.paths] +# treat these directories as the same when combining +# the first item is going to be the canonical dir +source = [ + "src/pytest_bdd", + ".tox/*/lib/python*/site-packages/pytest_bdd", +] + [tool.mypy] python_version = "3.7" diff --git a/tox.ini b/tox.ini index 9a2d7b4..a5e2532 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ skip_missing_interpreters = true [testenv] setenv = - coverage: _PYTEST_CMD=coverage run --append -m pytest + coverage: _PYTEST_CMD=coverage run -m pytest xdist: _PYTEST_MORE_ARGS=-n3 -rfsxX deps = pytestlatest: pytest