def StopServer( ycm ): try: ycm.OnVimLeave() WaitUntilProcessIsTerminated( ycm._server_popen ) CloseStandardStreams( ycm._server_popen ) except Exception: pass
def Wrapper(*args, **kwargs): ycm = YouCompleteMe(_MakeUserOptions(custom_options)) _WaitUntilReady() try: test(ycm, *args, **kwargs) finally: ycm.OnVimLeave() WaitUntilProcessIsTerminated(ycm._server_popen)
def MockProcessTerminationTimingOut( handle, timeout = 5 ): WaitUntilProcessIsTerminated( handle, timeout ) raise RuntimeError( f'Waited process to terminate for { timeout } seconds, ' 'aborting.' )