-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line coverage metrics do not add up for executed_lines and summary.covered_lines in generated coverage.json #1900
Comments
I'd like to reproduce this, but I don't use poetry so I'm not sure how to get everything in order. Can you give the exact commands you used, starting with |
I think the three lines are the docstrings, but I'm not sure why they are treated differently. |
Yeah so here's the repo: https://github.com/JohnPeng47/textual-neutered
|
Also a shorter example here:
In this example, both covered_lines and num_statements should be 1 right, not 0? |
Also another thing that I just noticed now, is that the coverage collected on the same repo is different on Windows vs. Linux. Is this just inherent to the OS differences in settrace impl? |
There is no OS difference in the settrace implementation. Likely the difference is do to OS differences in textual repo. If you don't think that's the case, let's look at some more specific details. |
Ahh no I think that makes sense. But could you confirm: Is invariant for every file under coverage? |
Hey sorry to keep pestering, but do you think you can just answer that one question above? My coverage diffing code is broken for some reason, and I just want to be sure that the above condition should hold |
Describe the bug
Here below is an item in "files" generated from coverage.py:
I would expect len(executed_lines) == summary.covered_lines but the first is 18 and the later is 15. Where does the extra 3 come from?
To Reproduce
I tried this with the following:
pytest . --tb short --color no --cov=src\textual --cov-report json --continue-on-collection-errors --disable-warnings
On the https://github.com/Textualize/textual repo.
Expected behavior
My expectation is:
covered_lines + executed_lines + excluded_lines == summary.num_statements, but this seems to not be the case?
The text was updated successfully, but these errors were encountered: