import sys def html_it(): """Run coverage and make an HTML report for bom.py.""" import coverage cov = coverage.coverage() cov.start() import bom # pragma: nested cov.stop() # pragma: nested cov.html_report(bom, directory="../html_bom") 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("gold_bom", "html_bom", size_within=10, file_pattern="*.html") contains("html_bom/bom.html", ""3×4 = 12, ÷2 = 6±0"", ) clean("html_bom")