diff --git a/services/report/languages/pycoverage.py b/services/report/languages/pycoverage.py index 55ef0cbd8..5c4de6501 100644 --- a/services/report/languages/pycoverage.py +++ b/services/report/languages/pycoverage.py @@ -53,14 +53,15 @@ def process( str(ln), [] ) ] - report_file.append( - ln, - report_builder_session.create_coverage_line( - fixed_filename, - cov, - coverage_type=CoverageType.line, - labels_list_of_lists=label_list_of_lists, - ), - ) + if ln > 0: + report_file.append( + ln, + report_builder_session.create_coverage_line( + fixed_filename, + cov, + coverage_type=CoverageType.line, + labels_list_of_lists=label_list_of_lists, + ), + ) report_builder_session.append(report_file) return report_builder_session.output_report() diff --git a/services/report/languages/tests/unit/test_pycoverage.py b/services/report/languages/tests/unit/test_pycoverage.py index e89607c05..6da012e12 100644 --- a/services/report/languages/tests/unit/test_pycoverage.py +++ b/services/report/languages/tests/unit/test_pycoverage.py @@ -157,6 +157,20 @@ "excluded_lines": [], "contexts": {}, }, + "services/__init__.py": { + "executed_lines": [0], + "summary": { + "covered_lines": 0, + "num_statements": 0, + "percent_covered": "100.0", + "percent_covered_display": "100", + "missing_lines": 0, + "excluded_lines": 0, + }, + "missing_lines": [], + "excluded_lines": [], + "contexts": {"0": [0]}, + }, }, "labels_table": { "0": "",