summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-09-15 18:15:29 (GMT)
committerYury Selivanov <yury@magic.io>2016-09-15 18:15:29 (GMT)
commit965675e1e5809dfae0dad638f4af8d197d49178e (patch)
treed75c079f590a66ee9270ee269662115bd096f6fb /Lib/test
parent44f05608d3df3a0d67d21a117d917e2791ea5a7f (diff)
parentd070154fb5f35c33fd03ce941ec19ca15de32263 (diff)
downloadcpython-965675e1e5809dfae0dad638f4af8d197d49178e.zip
cpython-965675e1e5809dfae0dad638f4af8d197d49178e.tar.gz
cpython-965675e1e5809dfae0dad638f4af8d197d49178e.tar.bz2
Merge 3.6 (issue #27906)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_asyncio/test_base_events.py2
-rw-r--r--Lib/test/test_asyncio/test_selector_events.py14
2 files changed, 15 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 206ebc6..0efdc20 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -1634,7 +1634,7 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
self.loop.call_later.assert_called_with(constants.ACCEPT_RETRY_DELAY,
# self.loop._start_serving
mock.ANY,
- MyProto, sock, None, None)
+ MyProto, sock, None, None, mock.ANY)
def test_call_coroutine(self):
@asyncio.coroutine
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
index ff71c21..73bc3f3 100644
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -687,6 +687,20 @@ class BaseSelectorEventLoopTests(test_utils.TestCase):
selectors.EVENT_WRITE)])
self.loop.remove_writer.assert_called_with(1)
+ def test_accept_connection_multiple(self):
+ sock = mock.Mock()
+ sock.accept.return_value = (mock.Mock(), mock.Mock())
+ backlog = 100
+ # Mock the coroutine generation for a connection to prevent
+ # warnings related to un-awaited coroutines.
+ mock_obj = mock.patch.object
+ with mock_obj(self.loop, '_accept_connection2') as accept2_mock:
+ accept2_mock.return_value = None
+ with mock_obj(self.loop, 'create_task') as task_mock:
+ task_mock.return_value = None
+ self.loop._accept_connection(mock.Mock(), sock, backlog=backlog)
+ self.assertEqual(sock.accept.call_count, backlog)
+
class SelectorTransportTests(test_utils.TestCase):