Automatically combine coverage in report#2162
Conversation
| if options.no_combine: | ||
| self.coverage.load() | ||
| else: | ||
| self.coverage.load() |
There was a problem hiding this comment.
Kind of disappointed Claude didn't factor this out!
|
I went this route because if coverage is already combined, coverage report
coverage combine
coverage reportbut this is the least invasive way (it only changes the behavior of that first |
|
Sorry, which route? I'm missing something: with this code it's an error to combine if it's already been combined? |
|
The choices for fixing this were:
I chose the third option (the "route I went"), because it's the most helpful one that won't break someone's workflow if they already correctly use For example: If I made |
|
I see, thanks. Quickly reading the code, I had missed that the combined data was not written out. My only concern with combining but not saving is that |
|
I think we can do without |
This does not modify the state on disk, but one common newbie error is doing `coverage run ...` followed by `coverage report` which shows some, but not the true coverage. Default to doing the combine, but allow people to pass `--no-combine` if this breaks their workflows. Fixes coveragepy#1781
09c6db5 to
6cf5c84
Compare
|
Done, PTAL |
|
We have a problem. If the test cycle is I think it will be error-prone for these files to hang around, so we should re-consider having the implicit combine keep the data files. What would be bad about the implicit combine deleting the parallel files? Doing that would also mean that |
|
I'm making the change to remove the data files during the implicit combine. |
|
This is now released as part of coverage 7.14.0. |
This does not modify the state on disk, but one common newbie error is
doing
coverage run ...followed bycoverage reportwhich shows some,but not the true coverage.
Default to doing the combine, but allow people to pass
--no-combineifthis breaks their workflows.
Fixes #1781