Skip to content

Commit f94cb62

Browse files
committed
Annotated failing/erroring tests in test_zipfile and test_zipimport
1 parent d7d04da commit f94cb62

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Lib/test/test_zipfile/test_core.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3440,8 +3440,10 @@ class EncodedMetadataTests(unittest.TestCase):
34403440
"This is pure ASCII.\n".encode('ascii'),
34413441
# This is modern Japanese. (UTF-8)
34423442
"\u3053\u308c\u306f\u73fe\u4ee3\u7684\u65e5\u672c\u8a9e\u3067\u3059\u3002\n".encode('utf-8'),
3443+
# TODO RUSTPYTHON
3444+
# Uncomment when Shift JIS is supported
34433445
# This is obsolete Japanese. (Shift JIS)
3444-
"\u3053\u308c\u306f\u53e4\u3044\u65e5\u672c\u8a9e\u3067\u3059\u3002\n".encode('shift_jis'),
3446+
# "\u3053\u308c\u306f\u53e4\u3044\u65e5\u672c\u8a9e\u3067\u3059\u3002\n".encode('shift_jis'),
34453447
]
34463448

34473449
def setUp(self):
@@ -3481,25 +3483,29 @@ def _test_read(self, zipfp, expected_names, expected_content):
34813483
self.assertEqual(info.file_size, len(content))
34823484
self.assertEqual(zipfp.read(name), content)
34833485

3486+
@unittest.skip('TODO: RUSTPYTHON')
34843487
def test_read_with_metadata_encoding(self):
34853488
# Read the ZIP archive with correct metadata_encoding
34863489
with zipfile.ZipFile(TESTFN, "r", metadata_encoding='shift_jis') as zipfp:
34873490
self._test_read(zipfp, self.file_names, self.file_content)
34883491

3492+
@unittest.skip('TODO: RUSTPYTHON')
34893493
def test_read_without_metadata_encoding(self):
34903494
# Read the ZIP archive without metadata_encoding
34913495
expected_names = [name.encode('shift_jis').decode('cp437')
34923496
for name in self.file_names[:2]] + self.file_names[2:]
34933497
with zipfile.ZipFile(TESTFN, "r") as zipfp:
34943498
self._test_read(zipfp, expected_names, self.file_content)
34953499

3500+
@unittest.skip('TODO: RUSTPYTHON')
34963501
def test_read_with_incorrect_metadata_encoding(self):
34973502
# Read the ZIP archive with incorrect metadata_encoding
34983503
expected_names = [name.encode('shift_jis').decode('koi8-u')
34993504
for name in self.file_names[:2]] + self.file_names[2:]
35003505
with zipfile.ZipFile(TESTFN, "r", metadata_encoding='koi8-u') as zipfp:
35013506
self._test_read(zipfp, expected_names, self.file_content)
35023507

3508+
@unittest.skip('TODO: RUSTPYTHON')
35033509
def test_read_with_unsuitable_metadata_encoding(self):
35043510
# Read the ZIP archive with metadata_encoding unsuitable for
35053511
# decoding metadata
@@ -3508,6 +3514,7 @@ def test_read_with_unsuitable_metadata_encoding(self):
35083514
with self.assertRaises(UnicodeDecodeError):
35093515
zipfile.ZipFile(TESTFN, "r", metadata_encoding='utf-8')
35103516

3517+
@unittest.skip('TODO: RUSTPYTHON')
35113518
def test_read_after_append(self):
35123519
newname = '\u56db' # Han 'four'
35133520
expected_names = [name.encode('shift_jis').decode('cp437')
@@ -3534,13 +3541,15 @@ def test_read_after_append(self):
35343541
else:
35353542
self.assertEqual(zipfp.read(name), content)
35363543

3544+
@unittest.skip('TODO: RUSTPYTHON')
35373545
def test_write_with_metadata_encoding(self):
35383546
ZF = zipfile.ZipFile
35393547
for mode in ("w", "x", "a"):
35403548
with self.assertRaisesRegex(ValueError,
35413549
"^metadata_encoding is only"):
35423550
ZF("nonesuch.zip", mode, metadata_encoding="shift_jis")
35433551

3552+
@unittest.skip('TODO: RUSTPYTHON')
35443553
def test_cli_with_metadata_encoding(self):
35453554
errmsg = "Non-conforming encodings not supported with -c."
35463555
args = ["--metadata-encoding=shift_jis", "-c", "nonesuch", "nonesuch"]
@@ -3560,6 +3569,7 @@ def test_cli_with_metadata_encoding(self):
35603569
for name in self.file_names:
35613570
self.assertIn(name, listing)
35623571

3572+
@unittest.skip('TODO: RUSTPYTHON')
35633573
def test_cli_with_metadata_encoding_extract(self):
35643574
os.mkdir(TESTFN2)
35653575
self.addCleanup(rmtree, TESTFN2)

Lib/test/test_zipimport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ def testZip64CruftAndComment(self):
796796
files = self.getZip64Files()
797797
self.doTest(".py", files, "f65536", comment=b"c" * ((1 << 16) - 1))
798798

799+
@unittest.skip('TODO: RUSTPYTHON; (intermittent success/failures); ValueError: name="RustPython/crates/pylib/Lib/test/zipimport_data/sparse-zip64-c0-0x000000000.part" does not fit expected pattern.')
799800
def testZip64LargeFile(self):
800801
support.requires(
801802
"largefile",

0 commit comments

Comments
 (0)