summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipfile.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-09-03 22:51:09 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-09-03 22:51:09 (GMT)
commit88b215e20fae580c21ca103336c05e2be88cb565 (patch)
tree2042176800d26a86922d38c0bb95de66b26d42a4 /Lib/test/test_zipfile.py
parent57004c696aa883b4dae5516b6babd92e3f8b7de7 (diff)
downloadcpython-88b215e20fae580c21ca103336c05e2be88cb565.zip
cpython-88b215e20fae580c21ca103336c05e2be88cb565.tar.gz
cpython-88b215e20fae580c21ca103336c05e2be88cb565.tar.bz2
Issue #21440: test_zipfile: replace last direct calls to os.remove() with
support.unlink()
Diffstat (limited to 'Lib/test/test_zipfile.py')
-rw-r--r--Lib/test/test_zipfile.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 9b428e9..8dae2eb 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -717,7 +717,7 @@ class PyZipFileTests(unittest.TestCase):
with open(TESTFN, 'w') as f:
f.write('most definitely not a python file')
self.assertRaises(RuntimeError, zipfp.writepy, TESTFN)
- os.remove(TESTFN)
+ unlink(TESTFN)
def test_write_pyfile_bad_syntax(self):
os.mkdir(TESTFN2)
@@ -763,7 +763,7 @@ class ExtractTests(unittest.TestCase):
with open(writtenfile, "rb") as f:
self.assertEqual(fdata.encode(), f.read())
- os.remove(writtenfile)
+ unlink(writtenfile)
# remove the test file subdirectories
rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
@@ -781,7 +781,7 @@ class ExtractTests(unittest.TestCase):
with open(outfile, "rb") as f:
self.assertEqual(fdata.encode(), f.read())
- os.remove(outfile)
+ unlink(outfile)
# remove the test file subdirectories
rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
@@ -887,7 +887,7 @@ class ExtractTests(unittest.TestCase):
self.check_file(correctfile, content)
rmtree(fixedname.split('/')[0])
- os.remove(TESTFN2)
+ unlink(TESTFN2)
class OtherTests(unittest.TestCase):
@@ -1755,7 +1755,7 @@ class AbstractUniversalNewlineTests:
def tearDown(self):
for sep, fn in self.arcfiles.items():
- os.remove(fn)
+ unlink(fn)
unlink(TESTFN)
unlink(TESTFN2)