#NEWLINE# @ contextlib . contextmanager #NEWLINE# def start_server( self , app , port = 31337 ) : #NEWLINE# #INDENT# server = make_server ( '' , port , app ) #NEWLINE# self . server_process = multiprocessing . Process ( target = self . serve_forever ) #NEWLINE# try : #NEWLINE# #INDENT# self . server_process . start ( ) #NEWLINE# ( yield ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . _stop_server ( )