@@ -275,7 +275,8 @@ def test_pathlike_construction(self, alpharep):
275275 """
276276 zipfile_ondisk = self .zipfile_ondisk (alpharep )
277277 pathlike = FakePath (str (zipfile_ondisk ))
278- zipfile .Path (pathlike )
278+ root = zipfile .Path (pathlike )
279+ root .root .close ()
279280
280281 @pass_alpharep
281282 def test_traverse_pathlike (self , alpharep ):
@@ -374,6 +375,7 @@ def test_root_on_disk(self, alpharep):
374375 root = zipfile .Path (self .zipfile_ondisk (alpharep ))
375376 assert root .name == 'alpharep.zip' == root .filename .name
376377 assert root .stem == 'alpharep' == root .filename .stem
378+ root .root .close ()
377379
378380 @pass_alpharep
379381 def test_suffix (self , alpharep ):
@@ -565,7 +567,7 @@ def test_inheritance(self, alpharep):
565567 file = cls (alpharep ).joinpath ('some dir' ).parent
566568 assert isinstance (file , cls )
567569
568- @unittest .skipIf (sys .platform == 'win32' , " TODO: RUSTPYTHON, fails on Windows" )
570+ @unittest .skipIf (sys .platform == 'win32' , ' TODO: RUSTPYTHON; fails on Windows' )
569571 @parameterize (
570572 ['alpharep' , 'path_type' , 'subpath' ],
571573 itertools .product (
@@ -576,11 +578,13 @@ def test_inheritance(self, alpharep):
576578 )
577579 def test_pickle (self , alpharep , path_type , subpath ):
578580 zipfile_ondisk = path_type (str (self .zipfile_ondisk (alpharep )))
579-
580- saved_1 = pickle .dumps (zipfile .Path (zipfile_ondisk , at = subpath ))
581+ root = zipfile .Path (zipfile_ondisk , at = subpath )
582+ saved_1 = pickle .dumps (root )
583+ root .root .close ()
581584 restored_1 = pickle .loads (saved_1 )
582585 first , * rest = restored_1 .iterdir ()
583586 assert first .read_text (encoding = 'utf-8' ).startswith ('content of ' )
587+ restored_1 .root .close ()
584588
585589 @pass_alpharep
586590 def test_extract_orig_with_implied_dirs (self , alpharep ):
@@ -592,6 +596,7 @@ def test_extract_orig_with_implied_dirs(self, alpharep):
592596 # wrap the zipfile for its side effect
593597 zipfile .Path (zf )
594598 zf .extractall (source_path .parent )
599+ zf .close ()
595600
596601 @pass_alpharep
597602 def test_getinfo_missing (self , alpharep ):
0 commit comments