pytest-cov: Regression in 2.6.0: running coverage combine after pytest-cov now errors out

We run coverage in parallel=True mode, because we have some tests that spawn subprocesses, and we want to capture coverage for all of them. To get a complete report for codecov, the CI does:

pytest --cov ...
coverage combine
bash <(curl -s https://codecov.io/bash)

As far as I know, this was mandatory on pytest-cov 2.5.1 and earlier. Since 2.6.0 came out yesterday, our tests have been failing because coverage combine says No data to combine and it errors out, failing the test suite.

I think this may be happening because pytest-cov is now effectively running coverage combine itself, so that instead of being mandatory to run coverage combine, it’s now mandatory to not to run coverage combine? Possibly because of changes in #178? For now that seems to be working for us. But it’d be nice to confirm that our understanding is correct, and I figured you’d rather have a heads-up than not.

Our bug: https://github.com/python-trio/trio/issues/646

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

This auto-combine is problematic when you have several runs of pytest (say across different versions of python) and want to combine them. Please at least add an option to prevent pytest-cov doing this combining.

My take on this is that while pytest users tend to naturally gravitate to pytest-cov, it is actually not necessary and running coverage.py directly works just as well, and the whole setup has less moving parts https://coverage.readthedocs.io/en/stable/#quick-start. So, unless you need pytest-cov to achieve something specific, I suggest not to use it “just because we use pytest”.