summaryrefslogtreecommitdiff
path: root/test/farm/html/run_unicode.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-08-17 09:40:21 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-08-17 09:40:21 -0400
commit4293f61c09034945a852af00b2ac04207e64e82e (patch)
tree9d9a4aecf99c1d118a67ea510501e764ad297628 /test/farm/html/run_unicode.py
parent8e1e857632f8fc9c49c3aaada3b0ae0630fa4fbd (diff)
downloadpython-coveragepy-git-4293f61c09034945a852af00b2ac04207e64e82e.tar.gz
Properly handle Unicode characters in Python source when creating the HTML report (except surrogates come out as pairs of blots in the HTML). Fixes #124 and #144.
Diffstat (limited to 'test/farm/html/run_unicode.py')
-rw-r--r--test/farm/html/run_unicode.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/farm/html/run_unicode.py b/test/farm/html/run_unicode.py
new file mode 100644
index 00000000..210a9113
--- /dev/null
+++ b/test/farm/html/run_unicode.py
@@ -0,0 +1,20 @@
+def html_it():
+ """Run coverage and make an HTML report for unicode.py."""
+ import coverage
+ cov = coverage.coverage()
+ cov.start()
+ import unicode
+ cov.stop()
+ cov.html_report(unicode, directory="../html_unicode")
+
+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_unicode", "html_unicode", size_within=10, file_pattern="*.html")
+contains("html_unicode/unicode.html",
+ "<span class='str'>&quot;&#654;d&#729;&#477;b&#592;&#633;&#477;&#652;o&#596;&quot;</span>",
+ "<span class='str'>&quot;db40,dd00: x&#56128;&#56576;&quot;</span>",
+ )
+
+clean("html_unicode")