summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio/test_windows_utils.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-10-14 22:56:25 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-10-14 22:56:25 +0200
commitf67f4602426be4de9b0d0124cb99ecc5edbd70aa (patch)
tree19a28061d79e86f501744ffd91c0398c4f5dc13b /Lib/test/test_asyncio/test_windows_utils.py
parentee3e56105f666c38e83cf50957b1cac23f5360e0 (diff)
downloadcpython-git-f67f4602426be4de9b0d0124cb99ecc5edbd70aa.tar.gz
Issue #18643: asyncio.windows_utils now reuse socket.socketpair() on Windows if
available Since Python 3.5, socket.socketpair() is now also available on Windows. Make csock blocking before calling the accept() method, and fix also a typo in an error message.
Diffstat (limited to 'Lib/test/test_asyncio/test_windows_utils.py')
-rw-r--r--Lib/test/test_asyncio/test_windows_utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py
index 7ea3a6d380..3e7a211ea7 100644
--- a/Lib/test/test_asyncio/test_windows_utils.py
+++ b/Lib/test/test_asyncio/test_windows_utils.py
@@ -33,6 +33,8 @@ class WinsocketpairTests(unittest.TestCase):
ssock, csock = windows_utils.socketpair(family=socket.AF_INET6)
self.check_winsocketpair(ssock, csock)
+ @unittest.skipIf(hasattr(socket, 'socketpair'),
+ 'socket.socketpair is available')
@mock.patch('asyncio.windows_utils.socket')
def test_winsocketpair_exc(self, m_socket):
m_socket.AF_INET = socket.AF_INET
@@ -51,6 +53,8 @@ class WinsocketpairTests(unittest.TestCase):
self.assertRaises(ValueError,
windows_utils.socketpair, proto=1)
+ @unittest.skipIf(hasattr(socket, 'socketpair'),
+ 'socket.socketpair is available')
@mock.patch('asyncio.windows_utils.socket')
def test_winsocketpair_close(self, m_socket):
m_socket.AF_INET = socket.AF_INET