Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 9 additions & 4 deletions Lib/test/test_zipfile/_path/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def test_pathlike_construction(self, alpharep):
"""
zipfile_ondisk = self.zipfile_ondisk(alpharep)
pathlike = FakePath(str(zipfile_ondisk))
zipfile.Path(pathlike)
root = zipfile.Path(pathlike)
root.root.close()

@pass_alpharep
def test_traverse_pathlike(self, alpharep):
Expand Down Expand Up @@ -374,6 +375,7 @@ def test_root_on_disk(self, alpharep):
root = zipfile.Path(self.zipfile_ondisk(alpharep))
assert root.name == 'alpharep.zip' == root.filename.name
assert root.stem == 'alpharep' == root.filename.stem
root.root.close()

@pass_alpharep
def test_suffix(self, alpharep):
Expand Down Expand Up @@ -565,7 +567,7 @@ def test_inheritance(self, alpharep):
file = cls(alpharep).joinpath('some dir').parent
assert isinstance(file, cls)

@unittest.skipIf(sys.platform == 'win32', "TODO: RUSTPYTHON, fails on Windows")
@unittest.skipIf(sys.platform == 'win32', 'TODO: RUSTPYTHON; fails on Windows')
@parameterize(
['alpharep', 'path_type', 'subpath'],
itertools.product(
Expand All @@ -576,11 +578,13 @@ def test_inheritance(self, alpharep):
)
def test_pickle(self, alpharep, path_type, subpath):
zipfile_ondisk = path_type(str(self.zipfile_ondisk(alpharep)))

saved_1 = pickle.dumps(zipfile.Path(zipfile_ondisk, at=subpath))
root = zipfile.Path(zipfile_ondisk, at=subpath)
saved_1 = pickle.dumps(root)
root.root.close()
restored_1 = pickle.loads(saved_1)
first, *rest = restored_1.iterdir()
assert first.read_text(encoding='utf-8').startswith('content of ')
restored_1.root.close()

@pass_alpharep
def test_extract_orig_with_implied_dirs(self, alpharep):
Expand All @@ -592,6 +596,7 @@ def test_extract_orig_with_implied_dirs(self, alpharep):
# wrap the zipfile for its side effect
zipfile.Path(zf)
zf.extractall(source_path.parent)
zf.close()

@pass_alpharep
def test_getinfo_missing(self, alpharep):
Expand Down
152 changes: 113 additions & 39 deletions Lib/test/test_zipfile/test_core.py

Large diffs are not rendered by default.

Loading