Merge 3.2: test_httplib removes temporary files

This commit is contained in:
Victor Stinner 2011-09-21 01:09:29 +02:00
commit c61fae04f6
1 changed files with 2 additions and 0 deletions

View File

@ -588,6 +588,7 @@ class RequestBodyTest(TestCase):
self.assertEqual(b'body\xc1', f.read())
def test_file_body(self):
self.addCleanup(support.unlink, support.TESTFN)
with open(support.TESTFN, "w") as f:
f.write("body")
with open(support.TESTFN) as f:
@ -599,6 +600,7 @@ class RequestBodyTest(TestCase):
self.assertEqual(b'body', f.read())
def test_binary_file_body(self):
self.addCleanup(support.unlink, support.TESTFN)
with open(support.TESTFN, "wb") as f:
f.write(b"body\xc1")
with open(support.TESTFN, "rb") as f: