summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-03-20 09:43:29 -0400
committerNed Batchelder <ned@nedbatchelder.com>2012-03-20 09:43:29 -0400
commit2017d360f977e953030c558ab57295741e2160bd (patch)
tree2d18c15bed5362d19a4e7b8d0e9fd2b9b9b87254 /test
parent53357077986f061b6a1fbe2a15cde14c4da6dae8 (diff)
downloadpython-coveragepy-2017d360f977e953030c558ab57295741e2160bd.tar.gz
All the tests pass under PyPy: sys has a bogus __file__, Unicode is 4-byte, and pypy inserts an extra stack frame into tracebacks.
Diffstat (limited to 'test')
-rw-r--r--test/farm/html/run_unicode.py12
-rw-r--r--test/test_process.py4
2 files changed, 15 insertions, 1 deletions
diff --git a/test/farm/html/run_unicode.py b/test/farm/html/run_unicode.py
index 210a911..6ed4466 100644
--- a/test/farm/html/run_unicode.py
+++ b/test/farm/html/run_unicode.py
@@ -1,3 +1,5 @@
+import sys
+
def html_it():
"""Run coverage and make an HTML report for unicode.py."""
import coverage
@@ -14,7 +16,15 @@ runfunc(html_it, rundir="src")
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>",
)
+if sys.maxunicode == 65535:
+ contains("html_unicode/unicode.html",
+ "<span class='str'>&quot;db40,dd00: x&#56128;&#56576;&quot;</span>",
+ )
+else:
+ contains("html_unicode/unicode.html",
+ "<span class='str'>&quot;db40,dd00: x&#917760;&quot;</span>",
+ )
+
clean("html_unicode")
diff --git a/test/test_process.py b/test/test_process.py
index b40eac1..05857b1 100644
--- a/test/test_process.py
+++ b/test/test_process.py
@@ -226,6 +226,10 @@ class ProcessTest(CoverageTest):
# same traceback.
status, out = self.run_command_status("coverage run throw.py", 1)
out2 = self.run_command("python throw.py")
+ if '__pypy__' in sys.builtin_module_names:
+ # Pypy has an extra frame in the traceback for some reason
+ lines2 = out2.splitlines()
+ out2 = "".join([l+"\n" for l in lines2 if "toplevel" not in l])
self.assertMultiLineEqual(out, out2)
# But also make sure that the output is what we expect.