Skip to content

Commit

Permalink
[lcov] Exclude executed lines respected exclude configs
Browse files Browse the repository at this point in the history
  • Loading branch information
tingilee committed Sep 27, 2023
1 parent 24985c0 commit 30a27ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion coverage/lcovreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ def get_lcov(self, fr, analysis, outfile=None):
outfile.write("TN:\n")
outfile.write(f"SF:{fr.relative_filename()}\n")
source_lines = fr.source().splitlines()

sorted_excluded = sorted(analysis.excluded)
for covered in sorted(analysis.executed):
if executed in sorted_excluded:
# Do not report excluded as executed
continue
# Note: Coverage.py currently only supports checking *if* a line
# has been executed, not how many times, so we set this to 1 for
# nice output even if it's technically incorrect.
Expand Down

0 comments on commit 30a27ce

Please sign in to comment.