MCPcopy
hub / github.com/tornadoweb/tornado / run_handler

Method run_handler

tornado/test/circlerefs_test.py:140–160  ·  view source on GitHub ↗
(self, handler_class)

Source from the content-addressed store, hash-verified

138 self.assertNotIn(" name=c", str(cm.exception))
139
140 async def run_handler(self, handler_class):
141 app = web.Application(
142 [
143 (r"/", handler_class),
144 ]
145 )
146 socket, port = tornado.testing.bind_unused_port()
147 server = tornado.httpserver.HTTPServer(app)
148 server.add_socket(socket)
149
150 client = httpclient.AsyncHTTPClient()
151 with assert_no_cycle_garbage():
152 # Only the fetch (and the corresponding server-side handler)
153 # are being tested for cycles. In particular, the Application
154 # object has internal cycles (as of this writing) which we don't
155 # care to fix since in real world usage the Application object
156 # is effectively a global singleton.
157 await client.fetch(f"http://127.0.0.1:{port}/")
158 client.close()
159 server.stop()
160 socket.close()
161
162 def test_sync_handler(self):
163 class Handler(web.RequestHandler):

Callers 4

test_sync_handlerMethod · 0.95
test_coro_handlerMethod · 0.95
test_async_handlerMethod · 0.95

Calls 6

fetchMethod · 0.95
closeMethod · 0.95
assert_no_cycle_garbageFunction · 0.85
add_socketMethod · 0.80
stopMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected