mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Merge 3.5 (issue #28652)
This commit is contained in:
commit
5cb0c09fa6
2 changed files with 14 additions and 18 deletions
|
@ -1047,22 +1047,20 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
|
|||
MyProto, 'example.com', 80, sock=object())
|
||||
self.assertRaises(ValueError, self.loop.run_until_complete, coro)
|
||||
|
||||
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'no Unix sockets')
|
||||
def test_create_connection_wrong_sock(self):
|
||||
sock = socket.socket(socket.AF_UNIX)
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
with sock:
|
||||
coro = self.loop.create_connection(MyProto, sock=sock)
|
||||
with self.assertRaisesRegex(ValueError,
|
||||
'A TCP Stream Socket was expected'):
|
||||
'A Stream Socket was expected'):
|
||||
self.loop.run_until_complete(coro)
|
||||
|
||||
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'no Unix sockets')
|
||||
def test_create_server_wrong_sock(self):
|
||||
sock = socket.socket(socket.AF_UNIX)
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
with sock:
|
||||
coro = self.loop.create_server(MyProto, sock=sock)
|
||||
with self.assertRaisesRegex(ValueError,
|
||||
'A TCP Stream Socket was expected'):
|
||||
'A Stream Socket was expected'):
|
||||
self.loop.run_until_complete(coro)
|
||||
|
||||
@unittest.skipUnless(hasattr(socket, 'SOCK_NONBLOCK'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue