Remove the test file before writing it in case there is no write permission.

This might help fix some of the failures on Windows box(es).  It doesn't hurt
either way and ensure the tests are a little more self contained (ie have
less assumptions).
This commit is contained in:
Neal Norwitz 2008-04-10 05:46:39 +00:00
parent 60a819d681
commit 36a59b4a08
4 changed files with 7 additions and 5 deletions

View file

@ -25,13 +25,10 @@ class TestGzip(unittest.TestCase):
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):