#67 closed defect (fixed)
Line number count in <python:trace> test coverage report inaccurate
Reported by: | cmlenz | Owned by: | cmlenz |
---|---|---|---|
Priority: | major | Milestone: | 0.6 |
Component: | Recipe commands | Version: | 0.4 |
Keywords: | Cc: | ||
Operating System: |
Description
The counting of line numbers by the <python:trace> report is inaccurate if there are source files that don't have any coverage.
This is due to differences in how trace.py and bitten.util.loc count lines: The latter counts every non-commented, non-blank line that contains Python code, excluding “docstrings”. In particular, when statements spanning multiple lines are encountered, each of those lines is counted.
trace.py only counts lines that actually contain statements (which exludes for example lines that only contain else:), and a statement spanning multiple lines is count only as a single line.
The result is that the line counts for files without any coverage are in general higher than for those that have coverage. Thus, the graph displaying the percentage of total coverage will show a lower coverage than it should (as long as there are files without coverage).
When parsing trace.py output files to determine the number of lines, Bitten should also take the results of the loc.count() into account, and map the line hits onto the line numbers found by loc.count().
Attachments (0)
Change History (4)
comment:1 Changed 19 years ago by cmlenz
- Status changed from new to assigned
comment:2 Changed 19 years ago by cmlenz
- Resolution set to fixed
- Status changed from assigned to closed
comment:3 Changed 19 years ago by cmlenz
- Resolution fixed deleted
- Status changed from closed to reopened
A couple of regressions here:
- The line count for covered files now includes commented/blank lines, which it obviously shouldn't
- The percentage is completely wrong.
comment:4 Changed 19 years ago by cmlenz
- Resolution set to fixed
- Status changed from reopened to closed
Should be fixed in [303].