Kaydet (Commit) e7789b18 authored tarafından Neal Norwitz's avatar Neal Norwitz

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.
üst 2595e760
...@@ -25,13 +25,10 @@ class TestGzip(unittest.TestCase): ...@@ -25,13 +25,10 @@ class TestGzip(unittest.TestCase):
filename = test_support.TESTFN filename = test_support.TESTFN
def setUp (self): def setUp (self):
pass test_support.unlink(self.filename)
def tearDown (self): def tearDown (self):
try: test_support.unlink(self.filename)
os.unlink(self.filename)
except os.error:
pass
def test_write (self): def test_write (self):
......
...@@ -79,6 +79,9 @@ class MockNonBlockWriterIO(io.RawIOBase): ...@@ -79,6 +79,9 @@ class MockNonBlockWriterIO(io.RawIOBase):
class IOTest(unittest.TestCase): class IOTest(unittest.TestCase):
def setUp(self):
test_support.unlink(test_support.TESTFN)
def tearDown(self): def tearDown(self):
test_support.unlink(test_support.TESTFN) test_support.unlink(test_support.TESTFN)
...@@ -619,6 +622,7 @@ class TextIOWrapperTest(unittest.TestCase): ...@@ -619,6 +622,7 @@ class TextIOWrapperTest(unittest.TestCase):
def setUp(self): def setUp(self):
self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n" self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n"
self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii") self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii")
test_support.unlink(test_support.TESTFN)
def tearDown(self): def tearDown(self):
test_support.unlink(test_support.TESTFN) test_support.unlink(test_support.TESTFN)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment