From 92a3e8532fc4a2a1225c9ff24f29181b3e97863f Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sat, 24 Jun 2017 10:50:55 +0300 Subject: [PATCH] Drop deprecated RequestHandler.finish_connections --- CHANGES.rst | 2 +- aiohttp/web_server.py | 2 -- docs/web_reference.rst | 13 ------------- tests/autobahn/server.py | 2 +- tests/test_connector.py | 2 +- tests/test_web_request_handler.py | 8 ++++---- 6 files changed, 7 insertions(+), 22 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index b863c728e4e..6356f8c9fe6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,7 +9,7 @@ Changes - Make enable_compression work on HTTP/1.0 #1828 -- +- Drop deprecated `Server.finish_connections` - diff --git a/aiohttp/web_server.py b/aiohttp/web_server.py index f936395df17..b765d27849f 100644 --- a/aiohttp/web_server.py +++ b/aiohttp/web_server.py @@ -45,7 +45,5 @@ def shutdown(self, timeout=None): self._connections.clear() self.time_service.close() - finish_connections = shutdown - def __call__(self): return RequestHandler(self, loop=self._loop, **self._kwargs) diff --git a/docs/web_reference.rst b/docs/web_reference.rst index 48185cf130c..7bac2644b96 100644 --- a/docs/web_reference.rst +++ b/docs/web_reference.rst @@ -1391,19 +1391,6 @@ A protocol factory compatible with A :ref:`coroutine` that should be called to close all opened connections. - .. coroutinemethod:: Server.finish_connections(timeout) - - .. deprecated:: 1.2 - - A deprecated alias for :meth:`shutdown`. - - .. versionchanged:: 1.2 - - ``Server`` was called ``RequestHandlerFactory`` before ``aiohttp==1.2``. - - The rename has no deprecation period but it's safe: no user - should instantiate the class by hands. - Router ^^^^^^ diff --git a/tests/autobahn/server.py b/tests/autobahn/server.py index 447e152d147..f23b7069306 100644 --- a/tests/autobahn/server.py +++ b/tests/autobahn/server.py @@ -45,7 +45,7 @@ def main(loop): @asyncio.coroutine def finish(app, srv, handler): srv.close() - yield from handler.finish_connections() + yield from handler.shutdown() yield from srv.wait_closed() diff --git a/tests/test_connector.py b/tests/test_connector.py index ccee517743e..6648bed0263 100644 --- a/tests/test_connector.py +++ b/tests/test_connector.py @@ -1102,7 +1102,7 @@ def setUp(self): def tearDown(self): if self.handler: - self.loop.run_until_complete(self.handler.finish_connections()) + self.loop.run_until_complete(self.handler.shutdown()) self.loop.stop() self.loop.run_forever() self.loop.close() diff --git a/tests/test_web_request_handler.py b/tests/test_web_request_handler.py index b2865b2903d..0285c668045 100644 --- a/tests/test_web_request_handler.py +++ b/tests/test_web_request_handler.py @@ -34,7 +34,7 @@ def test_connections(loop): @asyncio.coroutine -def test_finish_connection_no_timeout(loop): +def test_shutdown_no_timeout(loop): app = web.Application() manager = app.make_handler(loop=loop) @@ -43,7 +43,7 @@ def test_finish_connection_no_timeout(loop): transport = mock.Mock() manager.connection_made(handler, transport) - yield from manager.finish_connections() + yield from manager.shutdown() manager.connection_lost(handler, None) assert manager.connections == [] @@ -51,7 +51,7 @@ def test_finish_connection_no_timeout(loop): @asyncio.coroutine -def test_finish_connection_timeout(loop): +def test_shutdown_timeout(loop): app = web.Application() manager = app.make_handler(loop=loop) @@ -60,7 +60,7 @@ def test_finish_connection_timeout(loop): transport = mock.Mock() manager.connection_made(handler, transport) - yield from manager.finish_connections(timeout=0.1) + yield from manager.shutdown(timeout=0.1) manager.connection_lost(handler, None) assert manager.connections == []