def html_it(): """Run coverage and make an HTML report for a.""" import coverage cov = coverage.coverage() cov.start() import a cov.stop() cov.html_report(a, directory="../html") runfunc(html_it, rundir="src") # HTML files will change often. Check that the sizes are reasonable, # and check that certain key strings are in the output. compare("html", "gold_a", size_within=10) contains("html/a.html", ">if 1 < 2:<", "    a = 3", "67%" ) contains("html/index.html", "a", "67%" ) clean("html")