def setup(port): import stdio global MessageHandler, setup handler = MessageHandler(port) setup_api_functions(handler) stdio.redirect(port) del MessageHandler, setup handler.start()
def test_main_list(self): with stdio.redirect() as (stdout, stderr): main_list(os.getpid(), argparse.Namespace())