diff --git a/mypy/report.py b/mypy/report.py index 764cfec7799a..73942b6c5ae3 100644 --- a/mypy/report.py +++ b/mypy/report.py @@ -689,6 +689,8 @@ def on_finish(self) -> None: self.root_package.covered_lines, self.root_package.total_lines ) self.root.attrib["branch-rate"] = "0" + self.root.attrib["lines-covered"] = str(self.root_package.covered_lines) + self.root.attrib["lines-valid"] = str(self.root_package.total_lines) sources = etree.SubElement(self.root, "sources") source_element = etree.SubElement(sources, "source") source_element.text = os.getcwd() diff --git a/test-data/unit/reports.test b/test-data/unit/reports.test index 81e24240af2d..6e0fdba8aaa3 100644 --- a/test-data/unit/reports.test +++ b/test-data/unit/reports.test @@ -27,7 +27,7 @@ def bar() -> str: def untyped_function(): return 42 [outfile build/cobertura.xml] - + $PWD @@ -81,7 +81,7 @@ def foo(a: int) -> MyDict: return {"a": a} md: MyDict = MyDict(**foo(42)) [outfile build/cobertura.xml] - + $PWD