[pypy-svn] pypy default: (anto, dario, rguillebert) Adds an app level test for the pyexpat

rguillebert commits-noreply at bitbucket.org
Thu Apr 28 17:21:51 CEST 2011


Author: Romain Guillebert <romain.py at gmail.com>
Branch: 
Changeset: r43721:dec1401601ca
Date: 2011-04-28 17:19 +0200
http://bitbucket.org/pypy/pypy/changeset/dec1401601ca/

Log:	(anto, dario, rguillebert) Adds an app level test for the pyexpat
	RPython module

diff --git a/pypy/module/pyexpat/test/test_parser.py b/pypy/module/pyexpat/test/test_parser.py
--- a/pypy/module/pyexpat/test/test_parser.py
+++ b/pypy/module/pyexpat/test/test_parser.py
@@ -1,5 +1,6 @@
 from pypy.conftest import gettestobjspace
 from pypy.module.pyexpat.interp_pyexpat import global_storage
+from pytest import skip
 
 class AppTestPyexpat:
     def setup_class(cls):
@@ -28,6 +29,15 @@
         assert isinstance(pyexpat.version_info, tuple)
         assert isinstance(pyexpat.version_info[0], int)
 
+    def test_malformed_xml(self):
+        import sys
+        if sys.platform == "darwin":
+            skip("Fails with the version of expat on Mac OS 10.6.6")
+	import pyexpat
+        xml = "\0\r\n"
+	parser = pyexpat.ParserCreate()
+	raises(pyexpat.ExpatError, "parser.Parse(xml, True)")
+
     def test_encoding(self):
         import pyexpat
         for encoding_arg in (None, 'utf-8', 'iso-8859-1'):


More information about the Pypy-commit mailing list