diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-17 09:40:21 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-17 09:40:21 -0400 |
commit | 4293f61c09034945a852af00b2ac04207e64e82e (patch) | |
tree | 9d9a4aecf99c1d118a67ea510501e764ad297628 /test/farm/html/run_unicode.py | |
parent | 8e1e857632f8fc9c49c3aaada3b0ae0630fa4fbd (diff) | |
download | python-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.py | 20 |
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'>"ʎd˙ǝbɐɹǝʌoɔ"</span>", + "<span class='str'>"db40,dd00: x��"</span>", + ) + +clean("html_unicode") |