Combine issues in tox examples for coverage 5
See original GitHub issueRe: https://github.com/pytest-dev/pytest-cov/commit/d3daf7608a327c10f8b77de462791078a0596434
I have been looking into this a bit today. It appears from the latest coveragepy source that the only reference to the [paths]
config—or at least the only reference I could find—is here.
This means that the filepaths are not combined properly somehow when merely doing --cov-append
(I’m guessing this difference has something to do with the new db format for the .coverage data file).
I have managed a workaround by setting a different data file per environment and then combining during the report step, i.e. for examples/src-layout/tox.ini:
...
[testenv]
commands = pytest --cov {posargs:-vv}
setenv =
{py27,py38}: COVERAGE_FILE=.coverage.{envname}
...
[testenv:report]
commands =
coverage combine
...
I suspect the “correct” fix here is to have pytest-cov respect the [run] parallel
flag and add a suffix to the data file as vanilla coverage does. This would at least remove the need for the ugly setenv
above. It would kinda break old behaviour though, needing to add a coverage combine
down there, so it would probably have to wait for pytest-cov 3.0…
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top GitHub Comments
@joshringer or anyone: fyi there’s a big change in master now to how --cov-append works. Give it a try now, there’ll be a new pytest-cov release soon.
Nice, v2.9.0 looks good to me. Thanks!