--- tests/testxmlgen.py
+++ tests/testxmlgen.py
@@ -20,6 +20,7 @@
import xml.sax, xml.sax.saxutils
import StringIO
+import sys
import unittest
class MyGen(xml.sax.saxutils.XMLGenerator):
@@ -70,14 +71,16 @@
Hello world
"""
- parser.feed(testcontent)
- parser.close()
- expectedresult="""
+ if sys.version_info < (2, 7):
+ self.assertRaises(KeyError, parser.feed, testcontent)
+ else:
+ parser.feed(testcontent)
+ parser.close()
+ expectedresult="""
Hello world
"""
- self.assertEqual( outfp.getvalue(), expectedresult)
-# self.assertRaises(KeyError, parser.feed, testcontent)
+ self.assertEqual( outfp.getvalue(), expectedresult)
def test_myxml(self):
""" Test that my patch works """