blob: a34fab9fc4eec20d820c2eeaf6447a3d1f9c4228 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
import sys
def html_it():
"""Run coverage.py 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_py.html",
'<span class="str">"3×4 = 12, ÷2 = 6±0"</span>',
)
clean("html_bom")
|