summaryrefslogtreecommitdiff
path: root/test/farm/html/run_a.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/farm/html/run_a.py')
-rw-r--r--test/farm/html/run_a.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/farm/html/run_a.py b/test/farm/html/run_a.py
new file mode 100644
index 00000000..ab0da42e
--- /dev/null
+++ b/test/farm/html/run_a.py
@@ -0,0 +1,25 @@
+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 &lt; 2:<",
+ "&nbsp; &nbsp; a = 3",
+ "<span class='pc_cov'>67%</span>"
+ )
+contains("html/index.html",
+ "<a href='a.html'>a</a>",
+ "<span class='pc_cov'>67%</span>"
+ )
+
+clean("html")