Skip to content

Commit c4b374b

Browse files
committed
etree: Use XMLPullParser.flush to fix XMLPullParserTest for Expat 2.6.0
1 parent 429c3c6 commit c4b374b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Lib/test/test_xml_etree.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@
121121
</foo>
122122
"""
123123

124-
fails_with_expat_2_6_0 = (unittest.expectedFailure
125-
if pyexpat.version_info >= (2, 6, 0) else
126-
lambda test: test)
127-
128124
def checkwarnings(*filters, quiet=False):
129125
def decorator(test):
130126
def newtest(*args, **kwargs):
@@ -1468,6 +1464,7 @@ def _feed(self, parser, data, chunk_size=None):
14681464
else:
14691465
for i in range(0, len(data), chunk_size):
14701466
parser.feed(data[i:i+chunk_size])
1467+
parser.flush()
14711468

14721469
def assert_events(self, parser, expected, max_events=None):
14731470
self.assertEqual(
@@ -1506,11 +1503,9 @@ def test_simple_xml(self, chunk_size=None):
15061503
self.assert_event_tags(parser, [('end', 'root')])
15071504
self.assertIsNone(parser.close())
15081505

1509-
@fails_with_expat_2_6_0
15101506
def test_simple_xml_chunk_1(self):
15111507
self.test_simple_xml(chunk_size=1)
15121508

1513-
@fails_with_expat_2_6_0
15141509
def test_simple_xml_chunk_5(self):
15151510
self.test_simple_xml(chunk_size=5)
15161511

0 commit comments

Comments
 (0)