Kaydet (Commit) 789e359f authored tarafından Victor Stinner's avatar Victor Stinner Kaydeden (comit) Yury Selivanov

bpo-32636: Fix two bugs in test_asyncio (#5302)

üst fb5a7ad4
......@@ -1917,6 +1917,7 @@ class BaseLoopSendfileTests(test_utils.TestCase):
def test_nonstream_socket(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setblocking(False)
self.addCleanup(sock.close)
with self.assertRaisesRegex(ValueError, "only SOCK_STREAM type"):
self.run_loop(self.loop.sock_sendfile(sock, self.file))
......
......@@ -2448,7 +2448,7 @@ class CTask_Future_Tests(test_utils.TestCase):
self.loop = asyncio.new_event_loop()
try:
fut = Fut(loop=self.loop)
self.loop.call_later(0.1, fut.set_result(1))
self.loop.call_later(0.1, fut.set_result, 1)
task = asyncio.Task(coro(), loop=self.loop)
res = self.loop.run_until_complete(task)
finally:
......
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