#NEWLINE# @ pytest . yield_fixture #NEWLINE# def start_scheduler( self , request , io_loop , scheduler ) : #NEWLINE# #INDENT# io_loop . add_callback ( scheduler . start ) #NEWLINE# thread = Thread ( target = io_loop . start ) #NEWLINE# ( yield thread . start ) #NEWLINE# if scheduler . running : #NEWLINE# #INDENT# io_loop . add_callback ( scheduler . shutdown ) #NEWLINE# #UNINDENT# io_loop . add_callback ( io_loop . stop ) #NEWLINE# thread . join ( )