From 83559c199fe13b9817f17e7c93c037e4468a4f0a Mon Sep 17 00:00:00 2001 From: SOUBHIK KUMAR MITRA Date: Fri, 13 Sep 2024 16:29:47 +0530 Subject: [PATCH] Fix unit tests --- mypy/test/testreports.py | 13 ------------- test-data/unit/reports.test | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/mypy/test/testreports.py b/mypy/test/testreports.py index 8b84be1d1b12..ff6bf338752b 100644 --- a/mypy/test/testreports.py +++ b/mypy/test/testreports.py @@ -54,16 +54,3 @@ def test_as_xml(self) -> None: assert_equal( expected_output, etree.tostring(cobertura_package.as_xml(), pretty_print=True) ) - with tempfile.TemporaryDirectory() as tempdir: - reports = Reports(data_dir=tempdir, report_dirs={"dummy_report": tempdir}) - - cobertura_reporter = CoberturaXmlReporter(reports, ".") - cobertura_reporter.root_package = cobertura_package - cobertura_reporter.on_finish() - - # Convert the XML document to a string - xml_str = etree.tostring(cobertura_reporter.doc, pretty_print=True).decode("utf-8") - - # Check that the required attributes are present - assert f'lines-covered="{cobertura_package.covered_lines}"' in xml_str - assert f'lines-valid="{cobertura_package.total_lines}"' in xml_str 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