|
26 | 26 | to_asyncio_future, |
27 | 27 | AddThreadSelectorEventLoop, |
28 | 28 | ) |
29 | | -from tornado.testing import AsyncTestCase, gen_test, setup_with_context_manager |
| 29 | +from tornado.testing import ( |
| 30 | + AsyncTestCase, |
| 31 | + gen_test, |
| 32 | + setup_with_context_manager, |
| 33 | + AsyncHTTPTestCase, |
| 34 | +) |
30 | 35 | from tornado.test.util import ignore_deprecation |
| 36 | +from tornado.web import Application, RequestHandler |
31 | 37 |
|
32 | 38 |
|
33 | 39 | class AsyncIOLoopTest(AsyncTestCase): |
@@ -276,13 +282,13 @@ def get_app(self) -> Application: |
276 | 282 | class Handler(RequestHandler): |
277 | 283 | async def get(self): |
278 | 284 | # On the Windows platform, |
279 | | - # when a asyncio.events.Handle is created |
280 | | - # in the SelectorThread without providing a context, |
281 | | - # it will copy the current thread's context, |
282 | | - # which can lead to the loss of the main thread's context |
283 | | - # when executing the handle. |
284 | | - # Therefore, it is necessary to |
285 | | - # save a copy of the main thread's context in the SelectorThread |
| 285 | + # when a asyncio.events.Handle is created |
| 286 | + # in the SelectorThread without providing a context, |
| 287 | + # it will copy the current thread's context, |
| 288 | + # which can lead to the loss of the main thread's context |
| 289 | + # when executing the handle. |
| 290 | + # Therefore, it is necessary to |
| 291 | + # save a copy of the main thread's context in the SelectorThread |
286 | 292 | # for creating the handle. |
287 | 293 | self.write(tornado_test_ctx.get()) |
288 | 294 |
|
|
0 commit comments