[Python-3000-checkins] r61836 - python/branches/py3k/Lib/test/test_gzip.py python/branches/py3k/Lib/test/test_io.py

neal.norwitz python-3000-checkins at python.org
Mon Mar 24 07:18:09 CET 2008


Author: neal.norwitz
Date: Mon Mar 24 07:18:09 2008
New Revision: 61836

Modified:
   python/branches/py3k/Lib/test/test_gzip.py
   python/branches/py3k/Lib/test/test_io.py
Log:
Always try to delete the data file before and after the test.
This will hopefully avoid spurious failures if the file doesn't
have the proper permissions to write for some reason.


Modified: python/branches/py3k/Lib/test/test_gzip.py
==============================================================================
--- python/branches/py3k/Lib/test/test_gzip.py	(original)
+++ python/branches/py3k/Lib/test/test_gzip.py	Mon Mar 24 07:18:09 2008
@@ -25,13 +25,10 @@
     filename = test_support.TESTFN
 
     def setUp (self):
-        pass
+        test_support.unlink(self.filename)
 
     def tearDown (self):
-        try:
-            os.unlink(self.filename)
-        except os.error:
-            pass
+        test_support.unlink(self.filename)
 
 
     def test_write (self):

Modified: python/branches/py3k/Lib/test/test_io.py
==============================================================================
--- python/branches/py3k/Lib/test/test_io.py	(original)
+++ python/branches/py3k/Lib/test/test_io.py	Mon Mar 24 07:18:09 2008
@@ -79,6 +79,9 @@
 
 class IOTest(unittest.TestCase):
 
+    def setUp(self):
+        test_support.unlink(test_support.TESTFN)
+
     def tearDown(self):
         test_support.unlink(test_support.TESTFN)
 
@@ -619,6 +622,7 @@
     def setUp(self):
         self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n"
         self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii")
+        test_support.unlink(test_support.TESTFN)
 
     def tearDown(self):
         test_support.unlink(test_support.TESTFN)


More information about the Python-3000-checkins mailing list