Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop deprecated RequestHandler.finish_connections #2006

Merged
merged 1 commit into from
Jun 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Changes

- Make enable_compression work on HTTP/1.0 #1828

-
- Drop deprecated `Server.finish_connections`

-

Expand Down
2 changes: 0 additions & 2 deletions aiohttp/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 0 additions & 13 deletions docs/web_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1391,19 +1391,6 @@ A protocol factory compatible with
A :ref:`coroutine<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
^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion tests/autobahn/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
2 changes: 1 addition & 1 deletion tests/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions tests/test_web_request_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -43,15 +43,15 @@ 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 == []
handler.shutdown.assert_called_with(None)


@asyncio.coroutine
def test_finish_connection_timeout(loop):
def test_shutdown_timeout(loop):
app = web.Application()
manager = app.make_handler(loop=loop)

Expand All @@ -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 == []
Expand Down