Skip to content

Commit 554c62c

Browse files
committed
Skip newly tagged XML tests on java expat backend
1 parent 4d18a3a commit 554c62c

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎graalpython/lib-python/3/test/test_pyexpat.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ def test_supported_encodings(self, encoding):
320320
'UTF-8', 'utf-8', 'utf-16', 'utf-16le', 'utf-16be',
321321
'koi8-u', 'cp1125', 'cp1251', 'iso8859-5', 'mac-cyrillic',
322322
])
323+
@_skip_if_java_pyexpat_backend(
324+
"Java pyexpat backend currently does not support all encodings accepted through CPython's "
325+
"unknown-encoding handler and cannot report UTF-16 XML declarations consistently."
326+
)
323327
def test_supported_encodings2(self, encoding):
324328
out = self.Outputter()
325329
parser = expat.ParserCreate()
@@ -387,12 +391,20 @@ def test_non_text_encodings(self, encoding):
387391
with self.assertRaises(LookupError):
388392
parser.Parse(data, True)
389393

394+
@_skip_if_java_pyexpat_backend(
395+
"Java pyexpat backend reports an ExpatError instead of the codec's UnicodeError for an "
396+
"explicitly undefined encoding."
397+
)
390398
def test_undefined_encoding(self):
391399
parser = expat.ParserCreate()
392400
data = b'<?xml version="1.0" encoding="undefined"?>\n<root></root>'
393401
with self.assertRaises(UnicodeError):
394402
parser.Parse(data, True)
395403

404+
@_skip_if_java_pyexpat_backend(
405+
"Java pyexpat backend reports an ExpatError instead of the codec's LookupError for an "
406+
"unknown encoding."
407+
)
396408
def test_unknown_encoding(self):
397409
parser = expat.ParserCreate()
398410
data = b'<?xml version="1.0" encoding="xyz"?>\n<root></root>'
@@ -852,6 +864,10 @@ def test_change_size_2(self):
852864
self.assertEqual(self.n, 4)
853865

854866
class ElementDeclHandlerTest(unittest.TestCase):
867+
@_skip_if_java_pyexpat_backend(
868+
"Java pyexpat backend currently does not enforce Expat's integer return-value contract for "
869+
"NotStandaloneHandler."
870+
)
855871
def test_trigger_leak(self):
856872
# Unfixed, this test would leak the memory of the so-called
857873
# "content model" in function ``my_ElementDeclHandler`` of pyexpat.

‎graalpython/lib-python/3/test/test_xml_etree.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,10 @@ def test_resource_warnings_not_exhausted(self):
15001500
del it, elem
15011501
gc_collect()
15021502

1503+
@_skip_if_java_pyexpat_backend(
1504+
"Java pyexpat backend currently cannot match Expat's error wording for iterparse "
1505+
"trailing-content failures ('junk after document element')."
1506+
)
15031507
def test_resource_warnings_failed_iteration(self):
15041508
self.addCleanup(os_helper.unlink, TESTFN)
15051509
with open(TESTFN, "wb") as f:

0 commit comments

Comments
 (0)