#NEWLINE# @ pytest . fixture ( scope = 'module' ) #NEWLINE# def server( request ) : #NEWLINE# #INDENT# p1 = TProcessor ( mux . ThingOneService , DispatcherOne ( ) ) #NEWLINE# p2 = TProcessor ( mux . ThingTwoService , DispatcherTwo ( ) ) #NEWLINE# mux_proc = TMultiplexedProcessor ( ) #NEWLINE# mux_proc . register_processor ( 'ThingOneService' , p1 ) #NEWLINE# mux_proc . register_processor ( 'ThingTwoService' , p2 ) #NEWLINE# _server = TThreadedServer ( mux_proc , TServerSocket ( unix_socket = sock_path ) , iprot_factory = TBinaryProtocolFactory ( ) , itrans_factory = TBufferedTransportFactory ( ) ) #NEWLINE# ps = multiprocessing . Process ( target = _server . serve ) #NEWLINE# ps . start ( ) #NEWLINE# time . sleep ( 0.1 ) #NEWLINE# def fin( ) : #NEWLINE# #INDENT# if ps . is_alive ( ) : #NEWLINE# #INDENT# ps . terminate ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# os . remove ( sock_path ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# request . addfinalizer ( fin )