from tornado.testing import AsyncTestCase, gen_test class TestSomething(AsyncTestCase): @gen_test async def test_something_async(self): await my_modern_async_function() @gen_test def test_something_else_async(self): yield another_async_function()
get_login_url, although they're kind of an awkward fit for modern development patterns. they're only loosely connected to the rest of tornado so if they're not working for you feel free to just replace
@authenticatedand those two methods with something else
TypeError: a coroutine was expected, got <Future pending…etc...
ensure_future, which makes sense if the task is already created and a Future is returned
server.start(0). It seems the main process never returns in
start()(different to os.fork() which returns process id's). is there some event queue which i can put functions into without calling
text/and the ones listed at https://github.com/tornadoweb/tornado/blob/865b6f7298f13d27423dba9fa907a1d2f8bdc1c0/tornado/web.py#L3069-L3079 )
hey all - i made a codemod for replacing tornado gen coroutines with native
async/await functions a while back and have been using it for upgrading some code at work. it's built on instagrams new libcst python codemod library.
thought i'd share it here in case anyone wants to use it! https://github.com/zhammer/tornado-async-transformer
Hey. I'm having a problem where, in Tornado, specifically in some tests using the AsyncTestCase class, I observe a tendency for SqlAlchemy objects/models to become detached after yield'ing in my code. Is there a way to work around this ??
(Admittedly may be wrong here, it's my working hypothesis)