Skip to content

Commit 53bd167

Browse files
befelemehroncok
authored andcommitted
00466: Downstream only: Skip tests not working with older expat version
We want to run these tests in Fedora and EPEL 10, but not in EPEL 9, which has too old version of expat. We set the upper bound version in the conditionalized skip to a release available in CentOS Stream 10, which is tested as working.
1 parent 2179603 commit 53bd167

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Lib/test/test_pyexpat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,8 @@ def start_element(name, _):
790790

791791
self.assertEqual(started, ['doc'])
792792

793+
@unittest.skipIf(expat.version_info < (2, 7, 1),
794+
f"Skip for expat < 2.7.1 (version available in RHEL 10)")
793795
def test_reparse_deferral_disabled(self):
794796
started = []
795797

Lib/test/test_sax.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,8 @@ def test_flush_reparse_deferral_enabled(self):
12411241

12421242
self.assertEqual(result.getvalue(), start + b"<doc></doc>")
12431243

1244+
@unittest.skipIf(pyexpat.version_info < (2, 7, 1),
1245+
f"Skip for expat < 2.7.1 (version available in RHEL 10)")
12441246
def test_flush_reparse_deferral_disabled(self):
12451247
result = BytesIO()
12461248
xmlgen = XMLGenerator(result)

Lib/test/test_xml_etree.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,9 +1547,13 @@ def test_simple_xml(self, chunk_size=None, flush=False):
15471547
self.assert_event_tags(parser, [('end', 'root')])
15481548
self.assertIsNone(parser.close())
15491549

1550+
@unittest.skipIf(pyexpat.version_info < (2, 7, 1),
1551+
f"Skip for expat < 2.7.1 (version available in RHEL 10)")
15501552
def test_simple_xml_chunk_1(self):
15511553
self.test_simple_xml(chunk_size=1, flush=True)
15521554

1555+
@unittest.skipIf(pyexpat.version_info < (2, 7, 1),
1556+
f"Skip for expat < 2.7.1 (version available in RHEL 10)")
15531557
def test_simple_xml_chunk_5(self):
15541558
self.test_simple_xml(chunk_size=5, flush=True)
15551559

@@ -1774,6 +1778,8 @@ def test_flush_reparse_deferral_enabled(self):
17741778

17751779
self.assert_event_tags(parser, [('end', 'doc')])
17761780

1781+
@unittest.skipIf(pyexpat.version_info < (2, 7, 1),
1782+
f"Skip for expat < 2.7.1 (version available in RHEL 10)")
17771783
def test_flush_reparse_deferral_disabled(self):
17781784
parser = ET.XMLPullParser(events=('start', 'end'))
17791785

0 commit comments

Comments
 (0)