diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_pyexpat.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py index 8ef3917..95a614b 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py @@ -236,6 +236,18 @@ class ParseTest(unittest.TestCase): operations = out.out self._verify_parse_output(operations) + def test_parse_again(self): + parser = expat.ParserCreate() + file = BytesIO(data) + parser.ParseFile(file) + # Issue 6676: ensure a meaningful exception is raised when attempting + # to parse more than one XML document per xmlparser instance, + # a limitation of the Expat library. + with self.assertRaises(expat.error) as cm: + parser.ParseFile(file) + self.assertEqual(expat.ErrorString(cm.exception.code), + expat.errors.XML_ERROR_FINISHED) + class NamespaceSeparatorTest(unittest.TestCase): def test_legal(self): # Tests that make sure we get errors when the namespace_separator value |