def Wrapper(*args, **kwargs): with IsolatedApp(custom_options) as app: clangd_completer.CLANGD_COMMAND = clangd_completer.NOT_CACHED try: test(app, *args, **kwargs) finally: StopCompleterServer(app, 'cpp')
def Wrapper( *args, **kwargs ): with IsolatedApp( custom_options ) as app: app.post_json( '/ignore_extra_conf_file', { 'filepath': YCMD_EXTRA_CONF } ) app.post_json( '/ignore_extra_conf_file', { 'filepath': PathToTestFile( '.ycm_extra_conf.py' ) } ) test( app, *args, **kwargs )
def Wrapper(*args, **kwargs): with IgnoreExtraConfOutsideTestsFolder(): with IsolatedApp(custom_options) as app: try: test(app, *args, **kwargs) finally: StopCompleterServer(app, 'foo')
def Wrapper(*args, **kwargs): with IsolatedApp() as app: try: with CurrentWorkingDirectory(directory): test(app, *args, **kwargs) finally: StopCompleterServer(app, 'javascript')
def Wrapper(test_case_instance, *args, **kwargs): with IsolatedApp(custom_options) as app: try: test(test_case_instance, app, *args, **kwargs) finally: global shared_filepaths for filepath in shared_filepaths.get(app, []): StopCompleterServer(app, 'cs', filepath)
def Wrapper( *args, **kwargs ): custom_options.update( { 'use_clangd': 'Always' } ) with IgnoreExtraConfOutsideTestsFolder(): with IsolatedApp( custom_options ) as app: clangd_completer.CLANGD_COMMAND = clangd_completer.NOT_CACHED try: test( app, *args, **kwargs ) finally: StopCompleterServer( app, 'cpp' )
def app( request ): which = request.param[ 0 ] assert which == 'isolated' or which == 'shared' if which == 'isolated': with IsolatedApp( request.param[ 1 ] ) as app: yield app else: global shared_app ClearCompletionsCache() yield shared_app
def Wrapper(*args, **kwargs): with patch( 'ycmd.completers.javascript.hook.' 'ShouldEnableTernCompleter', return_value=False): with IsolatedApp() as app: try: test(app, *args, **kwargs) finally: StopCompleterServer(app, 'javascript')
def Wrapper(test_case_instance, *args, **kwargs): with patch( 'ycmd.completers.javascript.hook.' 'ShouldEnableTernCompleter', return_value=False): with IsolatedApp(custom_options) as app: try: test(test_case_instance, app, *args, **kwargs) finally: StopCompleterServer(app, 'javascript')
def Wrapper(*args, **kwargs): with IsolatedApp(custom_options) as app: # We are not wrapping test() in a try/finally block and calling # StopCompleterServer() needs the correct filename to stop the # specific server corresponding to the solution file. # # Leaving the file unspecified in StopCompleterServer() starts # a new server only to shut it down right afterwards. # Instead, we leave the server running and let tearDownPackage() # stop all the running servers by running through all shared_filepaths. test(app, *args, **kwargs)
def app( request ): which = request.param[ 0 ] assert which == 'isolated' or which == 'shared' if which == 'isolated': with IsolatedApp( {} ) as app: yield app StopCompleterServer( app, 'javascript' ) else: global shared_app ClearCompletionsCache() yield shared_app
def app(request): which = request.param[0] assert which == 'isolated' or which == 'shared' if which == 'isolated': custom_options = request.param[1] with IsolatedApp(custom_options) as app: yield app else: global shared_app ClearCompletionsCache() with IgnoreExtraConfOutsideTestsFolder(): yield shared_app
def app(request): which = request.param[0] assert which == 'isolated' or which == 'shared' if which == 'isolated': custom_options = request.param[1] custom_options.update({'use_clangd': 0}) with IsolatedApp(custom_options) as app: yield app else: global shared_app ClearCompletionsCache() yield shared_app
def app(request): which = request.param[0] assert which == 'isolated' or which == 'shared' if which == 'isolated': with IsolatedApp({}) as app: yield app StopCompleterServer(app, 'rust') else: global shared_app ClearCompletionsCache() with IgnoreExtraConfOutsideTestsFolder(): yield shared_app
def app(request): which = request.param[0] assert which == 'isolated' or which == 'shared' if which == 'isolated': with IsolatedApp(request.param[1]) as app: clangd_completer.CLANGD_COMMAND = clangd_completer.NOT_CACHED yield app StopCompleterServer(app, 'cpp') else: global shared_app ClearCompletionsCache() with IgnoreExtraConfOutsideTestsFolder(): yield shared_app
def app(request): which = request.param[0] assert which == 'isolated' or which == 'shared' if which == 'isolated': with IsolatedApp(request.param[1]) as app: try: yield app finally: StopCompleterServer(app, 'go') else: global shared_app ClearCompletionsCache() yield shared_app
def app(request): which = request.param[0] assert which == 'isolated' or which == 'shared' if which == 'isolated': custom_options = request.param[1] with IsolatedApp(custom_options) as app: yield app # Shutdown the isolated app for filepath in shared_filepaths.get(app, []): StopCompleterServer(app, 'cs', filepath) else: global shared_app ClearCompletionsCache() with IgnoreExtraConfOutsideTestsFolder(): yield shared_app
def isolated_app(custom_options={}): """Defines a context manager to be used in cases where it is easier to specify user options of the isolated ycmdat some point inside the function. Example usage: def some_test( isolated_app ): with TemporaryTestDir() as tmp_dir: with isolated_app( user_options ) as app: """ with IsolatedApp(custom_options) as app: try: yield app finally: StopCompleterServer(app, 'java')
def app( request ): which = request.param[ 0 ] print( which ) assert which == 'isolated' or which == 'shared' if which == 'isolated': with patch( 'ycmd.completers.javascript.hook.' 'ShouldEnableTernCompleter', return_value = False ): with IsolatedApp( request.param[ 1 ] ) as app: try: yield app finally: StopCompleterServer( app, 'go' ) else: global shared_app ClearCompletionsCache() yield shared_app
def app(request): which = request.param[0] print(which) assert which == 'isolated' or which == 'shared' if which == 'isolated': with patch( 'ycmd.completers.javascript.hook.' 'ShouldEnableTernCompleter', return_value=False): with IsolatedApp(request.param[1]) as app: yield app StopCompleterServer(app, 'javascript') else: global shared_app ClearCompletionsCache() with IgnoreExtraConfOutsideTestsFolder(): yield shared_app
def app(request): with IsolatedApp(request.param) as app: try: yield app finally: StopCompleterServer(app, 'foo')
def Wrapper(test_case_instance, *args, **kwargs): with IsolatedApp(custom_options) as app: try: test(test_case_instance, app, *args, **kwargs) finally: StopCompleterServer(app, 'java')
def Wrapper(*args, **kwargs): with IsolatedApp() as app: try: test(app, *args, **kwargs) finally: StopCompleterServer(app, 'javascript')
def Wrapper(*args, **kwargs): with IsolatedApp(custom_options) as app: test(app, *args, **kwargs)
def Wrapper(*args, **kwargs): with IsolatedApp(custom_options) as app: try: test(app, *args, **kwargs) finally: StopCompleterServer(app, 'typescript')
def Wrapper(test_case_instance, *args, **kwargs): custom_options.update({'use_clangd': 0}) with IsolatedApp(custom_options) as app: test(test_case_instance, app, *args, **kwargs)
def manager( custom_options = {} ): with IsolatedApp( custom_options ) as app: try: yield app finally: StopCompleterServer( app, 'java' )
def Wrapper(test_case_instance, *args, **kwargs): with IsolatedApp(custom_options) as app: test(test_case_instance, app, *args, **kwargs)
def Wrapper(*args, **kwargs): custom_options.update({'use_clangd': 0}) with IsolatedApp(custom_options) as app: test(app, *args, **kwargs)