Skip to content

Commit fb83592

Browse files
miss-islingtonvstinnerhroncok
authored
[3.13] GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740) (GH-145494) (#145510)
[3.14] GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740) (GH-145494) GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740) (cherry picked from commit 45e9343) (cherry picked from commit bcc2dd8) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Miro Hrončok <miro@hroncok.cz>
1 parent 0a239dd commit fb83592

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Lib/test/test_pyexpat.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,9 @@ def test_set_maximum_amplification__fail_for_subparser(self):
998998
self.assert_root_parser_failure(setter, 123.45)
999999

10001000

1001-
@unittest.skipIf(expat.version_info < (2, 7, 2), "requires Expat >= 2.7.2")
1001+
@unittest.skipIf(not hasattr(expat.XMLParserType,
1002+
"SetAllocTrackerMaximumAmplification"),
1003+
"requires Python compiled with Expat >= 2.7.2")
10021004
class MemoryProtectionTest(AttackProtectionTestBase, unittest.TestCase):
10031005

10041006
# NOTE: with the default Expat configuration, the billion laughs protection
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
When Python was compiled with system expat older then 2.7.2 but tests run
2+
with newer expat, still skip
3+
:class:`!test.test_pyexpat.MemoryProtectionTest`.

0 commit comments

Comments
 (0)