Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

AsyncHTTPTestCase: bind the server port earlier so it's available

in user-overridable methods like get_app.
  • Loading branch information...
commit fe0182da5542d49d2edf4c7dedc4a38d962c0772 1 parent 3747af5
@bdarnell bdarnell authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 tornado/testing.py
View
5 tornado/testing.py
@@ -262,14 +262,13 @@ def test_homepage(self):
'''
def setUp(self):
super(AsyncHTTPTestCase, self).setUp()
- self.__port = None
+ sock, port = bind_unused_port()
+ self.__port = port
self.http_client = self.get_http_client()
self._app = self.get_app()
self.http_server = self.get_http_server()
- sock, port = bind_unused_port()
self.http_server.add_sockets([sock])
- self.__port = port
def get_http_client(self):
return AsyncHTTPClient(io_loop=self.io_loop)
Please sign in to comment.
Something went wrong with that request. Please try again.