Fix #10591. Fix test_os for refleak runs.

Split a common setUp/tearDown into the appropriate parts.
This commit is contained in:
Brian Curtin 2010-11-30 23:46:54 +00:00
parent 715f3cd10d
commit c0abc4e3a4
1 changed files with 1 additions and 2 deletions

View File

@ -866,12 +866,11 @@ class LinkTests(unittest.TestCase):
self.file1 = support.TESTFN
self.file2 = os.path.join(support.TESTFN + "2")
def tearDown(self):
for file in (self.file1, self.file2):
if os.path.exists(file):
os.unlink(file)
tearDown = setUp
def _test_link(self, file1, file2):
with open(file1, "w") as f1:
f1.write("test")