Trying to get coverage report showing the coverage for the source files

This commit is contained in:
Alessio Bogon 2022-11-05 13:35:03 +01:00
parent aa036b165d
commit ca2ade7eed
3 changed files with 14 additions and 5 deletions

View File

@ -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:

View File

@ -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"

View File

@ -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