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