summaryrefslogtreecommitdiff
path: root/test/farm/html/run_partial.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-05-31 23:12:40 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-05-31 23:12:40 -0400
commit139497ac9cf495a13e9f3323db489bf56054f5d4 (patch)
treeeae49dfbee407d333ef61618351936ded5945297 /test/farm/html/run_partial.py
parent61deec574e9d0181ad986d1276e3d57e8427930d (diff)
downloadpython-coveragepy-git-139497ac9cf495a13e9f3323db489bf56054f5d4.tar.gz
Better handling of the partial-branch exclusion regexes. Finishes issue #113.
Diffstat (limited to 'test/farm/html/run_partial.py')
-rw-r--r--test/farm/html/run_partial.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/farm/html/run_partial.py b/test/farm/html/run_partial.py
new file mode 100644
index 00000000..3fb621a1
--- /dev/null
+++ b/test/farm/html/run_partial.py
@@ -0,0 +1,27 @@
+def html_it():
+ """Run coverage and make an HTML report for partial."""
+ import coverage
+ cov = coverage.coverage(branch=True)
+ cov.start()
+ import partial
+ cov.stop()
+ cov.html_report(partial, directory="../html_partial")
+
+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_partial", "html_partial", size_within=10, file_pattern="*.html")
+contains("html_partial/partial.html",
+ "<p id='t5' class='stm run hide_run'>",
+ "<p id='t8' class='stm run hide_run'>",
+ "<p id='t11' class='stm run hide_run'>",
+ # The "if 0" and "if 1" statements are optimized away.
+ "<p id='t14' class='pln'>",
+ )
+contains("html_partial/index.html",
+ "<a href='partial.html'>partial</a>",
+ "<span class='pc_cov'>100%</span>"
+ )
+
+clean("html_partial")