(self, handler_class)
| 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): |
no test coverage detected