def run_coverage(
        self,
        covargs: dict[str, Any] | None = None,
        htmlargs: dict[str, Any] | None = None,
    ) -> float:
        """Run coverage.py on main_file.py, and create an HTML report."""
        self.clean_local_file_imports()
        cov = coverage.Coverage(**(covargs or {}))
        self.start_import_stop(cov, "main_file")
        ret = cov.html_report(**(htmlargs or {}))
        self.assert_valid_hrefs()
        return ret
Run coverage.py on main_file.py, and create an HTML report.
tests/test_html.py