Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed all skips in test_core.py to expectedFailures
  • Loading branch information
terryluan12 committed Jan 6, 2026
commit 62074b78ff4adc180c8eb5a890ec374294aa7e24
16 changes: 8 additions & 8 deletions Lib/test/test_zipfile/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3483,29 +3483,29 @@ def _test_read(self, zipfp, expected_names, expected_content):
self.assertEqual(info.file_size, len(content))
self.assertEqual(zipfp.read(name), content)

@unittest.skip('TODO: RUSTPYTHON')
@unittest.expectedFailure # TODO: RUSTPYTHON;
def test_read_with_metadata_encoding(self):
# Read the ZIP archive with correct metadata_encoding
with zipfile.ZipFile(TESTFN, "r", metadata_encoding='shift_jis') as zipfp:
self._test_read(zipfp, self.file_names, self.file_content)

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

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

@unittest.skip('TODO: RUSTPYTHON')
@unittest.expectedFailure # TODO: RUSTPYTHON;
def test_read_with_unsuitable_metadata_encoding(self):
# Read the ZIP archive with metadata_encoding unsuitable for
# decoding metadata
Expand All @@ -3514,7 +3514,7 @@ def test_read_with_unsuitable_metadata_encoding(self):
with self.assertRaises(UnicodeDecodeError):
zipfile.ZipFile(TESTFN, "r", metadata_encoding='utf-8')

@unittest.skip('TODO: RUSTPYTHON')
@unittest.expectedFailure # TODO: RUSTPYTHON;
def test_read_after_append(self):
newname = '\u56db' # Han 'four'
expected_names = [name.encode('shift_jis').decode('cp437')
Expand All @@ -3541,15 +3541,15 @@ def test_read_after_append(self):
else:
self.assertEqual(zipfp.read(name), content)

@unittest.skip('TODO: RUSTPYTHON')
@unittest.expectedFailure # TODO: RUSTPYTHON;
def test_write_with_metadata_encoding(self):
ZF = zipfile.ZipFile
for mode in ("w", "x", "a"):
with self.assertRaisesRegex(ValueError,
"^metadata_encoding is only"):
ZF("nonesuch.zip", mode, metadata_encoding="shift_jis")

@unittest.skip('TODO: RUSTPYTHON')
@unittest.expectedFailure # TODO: RUSTPYTHON;
def test_cli_with_metadata_encoding(self):
errmsg = "Non-conforming encodings not supported with -c."
args = ["--metadata-encoding=shift_jis", "-c", "nonesuch", "nonesuch"]
Expand All @@ -3569,7 +3569,7 @@ def test_cli_with_metadata_encoding(self):
for name in self.file_names:
self.assertIn(name, listing)

@unittest.skip('TODO: RUSTPYTHON')
@unittest.expectedFailure # TODO: RUSTPYTHON;
def test_cli_with_metadata_encoding_extract(self):
os.mkdir(TESTFN2)
self.addCleanup(rmtree, TESTFN2)
Expand Down
Loading