

@gen_test
def asyncSetUp(self):
    (listener, port) = bind_unused_port()
    event = Event()

    def accept_callback(conn, addr):
        self.server_stream = IOStream(conn)
        self.addCleanup(self.server_stream.close)
        event.set()
    add_accept_handler(listener, accept_callback)
    self.client_stream = IOStream(socket.socket())
    self.addCleanup(self.client_stream.close)
    (yield [self.client_stream.connect(('127.0.0.1', port)), port.wait()])
    self.io_loop.remove_handler(listener)
    listener.close()

dataset/ETHPy150Open tornadoweb/tornado/tornado/test/http1connection_test.py HTTP1ConnectionTest.asyncSetUp/VarMisuse@114/142 `event`->`port`