diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2018-01-24 20:15:14 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2018-01-24 20:15:14 (GMT) |
commit | 789e359f51d2b27bea01b8c6c3bf090aaedf8839 (patch) | |
tree | 47a287104ab678eb942631a312d47e5168f1ac65 | |
parent | fb5a7ad421ac20c49218ee4b86fb0d85ca4cd664 (diff) | |
download | cpython-789e359f51d2b27bea01b8c6c3bf090aaedf8839.zip cpython-789e359f51d2b27bea01b8c6c3bf090aaedf8839.tar.gz cpython-789e359f51d2b27bea01b8c6c3bf090aaedf8839.tar.bz2 |
bpo-32636: Fix two bugs in test_asyncio (#5302)
-rw-r--r-- | Lib/test/test_asyncio/test_base_events.py | 1 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 8d72df6..6489f50 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -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)) diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 5e83a54..822338f 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -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: |