[Python-checkins] cpython (merge 3.4 -> default): (Merge 3.4) Issue #21440: test_zipfile: replace last direct calls to

victor.stinner python-checkins at python.org
Thu Sep 4 00:54:05 CEST 2014


http://hg.python.org/cpython/rev/73ce1afc6ee2
changeset:   92318:73ce1afc6ee2
parent:      92315:85511d4a846e
parent:      92317:6b4d31641109
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Sep 04 00:51:25 2014 +0200
summary:
  (Merge 3.4) Issue #21440: test_zipfile: replace last direct calls to
os.remove() with support.unlink()

files:
  Lib/test/test_zipfile.py |  10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -717,7 +717,7 @@
             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 @@
                 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 @@
                 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 @@
             self.check_file(correctfile, content)
             rmtree(fixedname.split('/')[0])
 
-            os.remove(TESTFN2)
+            unlink(TESTFN2)
 
 
 class OtherTests(unittest.TestCase):
@@ -1755,7 +1755,7 @@
 
     def tearDown(self):
         for sep, fn in self.arcfiles.items():
-            os.remove(fn)
+            unlink(fn)
         unlink(TESTFN)
         unlink(TESTFN2)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list