Skip to content

Commit 3e29365

Browse files
add import code
1 parent 3c2c148 commit 3e29365

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tornado/test/asyncio_test.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@
2626
to_asyncio_future,
2727
AddThreadSelectorEventLoop,
2828
)
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+
)
3035
from tornado.test.util import ignore_deprecation
36+
from tornado.web import Application, RequestHandler
3137

3238

3339
class AsyncIOLoopTest(AsyncTestCase):
@@ -276,13 +282,13 @@ def get_app(self) -> Application:
276282
class Handler(RequestHandler):
277283
async def get(self):
278284
# 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
286292
# for creating the handle.
287293
self.write(tornado_test_ctx.get())
288294

0 commit comments

Comments
 (0)