Skip to content

Commit

Permalink
etree: Use XMLPullParser.flush to fix XMLPullParserTest for Expat 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed Feb 18, 2024
1 parent 7928942 commit e5e4033
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Lib/test/test_xml_etree.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
</foo>
"""

fails_with_expat_2_6_0 = (unittest.expectedFailure
if pyexpat.version_info >= (2, 6, 0) else
lambda test: test)

def checkwarnings(*filters, quiet=False):
def decorator(test):
def newtest(*args, **kwargs):
Expand Down Expand Up @@ -1468,6 +1464,7 @@ def _feed(self, parser, data, chunk_size=None):
else:
for i in range(0, len(data), chunk_size):
parser.feed(data[i:i+chunk_size])
parser.flush()

def assert_events(self, parser, expected, max_events=None):
self.assertEqual(
Expand Down Expand Up @@ -1506,11 +1503,9 @@ def test_simple_xml(self, chunk_size=None):
self.assert_event_tags(parser, [('end', 'root')])
self.assertIsNone(parser.close())

@fails_with_expat_2_6_0
def test_simple_xml_chunk_1(self):
self.test_simple_xml(chunk_size=1)

@fails_with_expat_2_6_0
def test_simple_xml_chunk_5(self):
self.test_simple_xml(chunk_size=5)

Expand Down

0 comments on commit e5e4033

Please sign in to comment.