question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Combine issues in tox examples for coverage 5

See original GitHub issue

Re: 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ionelmccommented, May 21, 2020

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

0reactions
joshringercommented, May 25, 2020

Nice, v2.9.0 looks good to me. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coverage in tox for multiple python versions - Stack Overflow
For the cov env I use two commands. coverage combine that combines the reports, and; coverage html to generate the report and, if...
Read more >
Use tox, gitlab CI, and coverage (!32) · Merge requests · repos / data ...
Example python project for using gitlab-ci and workflow-utils to test and build ... An error occurred while retrieving approval data for this merge...
Read more >
tox configuration specification — tox 3.1.0 documentation
Factors and values substitution are compatible¶. It is possible to mix both values substitution and factor expressions. For example: [tox] envlist ...
Read more >
Release 4.0.0 pytest-cov contributors
8 Tox. 21. 9 Plugin coverage. 23. 10 Markers and fixtures ... For example if tests are contained within the directory tree being...
Read more >
Python tox - Why You Should Use It and Tutorial
Basic tox Example. 4. Multiple Python Version Example. 5. Running Arbitrary Commands Example. 6. Python Packaging Example.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found