File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -743,7 +743,7 @@ def __init__(
743743 self .running = False
744744 self .finished = False
745745 self .io_loop = IOLoop .current ()
746- if self .handle_yield ( first_yielded ):
746+ if self .ctx_run ( self . handle_yield , first_yielded ):
747747 gen = result_future = first_yielded = None # type: ignore
748748 self .ctx_run (self .run )
749749
Original file line number Diff line number Diff line change @@ -1114,6 +1114,16 @@ def test_reset(self):
11141114 # so we must make sure that we maintain that property across yield.
11151115 ctx_var .reset (token )
11161116
1117+ @gen_test
1118+ def test_propagate_to_first_yield_with_native_async_function (self ):
1119+ x = 10
1120+
1121+ async def native_async_function ():
1122+ self .assertEquals (ctx_var .get (), x )
1123+
1124+ ctx_var .set (x )
1125+ yield native_async_function ()
1126+
11171127
11181128if __name__ == "__main__" :
11191129 unittest .main ()
You can’t perform that action at this time.
0 commit comments