Kaydet (Commit) 547c1b9a authored tarafından Xavier de Gaye's avatar Xavier de Gaye

Fix temporary file not deleted in test_socket

üst 7ae41126
...@@ -1442,7 +1442,8 @@ class GeneralModuleTests(unittest.TestCase): ...@@ -1442,7 +1442,8 @@ class GeneralModuleTests(unittest.TestCase):
# type and populates the socket object. # type and populates the socket object.
# #
# On Windows this trick won't work, so the test is skipped. # On Windows this trick won't work, so the test is skipped.
fd, _ = tempfile.mkstemp() fd, path = tempfile.mkstemp()
self.addCleanup(os.unlink, path)
with socket.socket(family=42424, type=13331, fileno=fd) as s: with socket.socket(family=42424, type=13331, fileno=fd) as s:
self.assertEqual(s.family, 42424) self.assertEqual(s.family, 42424)
self.assertEqual(s.type, 13331) self.assertEqual(s.type, 13331)
......
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