Exemple #1
0
 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')
Exemple #2
0
 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 )
Exemple #3
0
 def Wrapper(*args, **kwargs):
     with IgnoreExtraConfOutsideTestsFolder():
         with IsolatedApp(custom_options) as app:
             try:
                 test(app, *args, **kwargs)
             finally:
                 StopCompleterServer(app, 'foo')
Exemple #4
0
 def Wrapper(*args, **kwargs):
     with IsolatedApp() as app:
         try:
             with CurrentWorkingDirectory(directory):
                 test(app, *args, **kwargs)
         finally:
             StopCompleterServer(app, 'javascript')
Exemple #5
0
 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)
Exemple #6
0
 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' )
Exemple #7
0
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
Exemple #8
0
 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')
Exemple #9
0
 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')
Exemple #10
0
 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)
Exemple #11
0
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
Exemple #15
0
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
Exemple #16
0
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
Exemple #18
0
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')
Exemple #19
0
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
Exemple #21
0
def app(request):
    with IsolatedApp(request.param) as app:
        try:
            yield app
        finally:
            StopCompleterServer(app, 'foo')
Exemple #22
0
 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')
Exemple #23
0
 def Wrapper(*args, **kwargs):
     with IsolatedApp() as app:
         try:
             test(app, *args, **kwargs)
         finally:
             StopCompleterServer(app, 'javascript')
Exemple #24
0
 def Wrapper(*args, **kwargs):
     with IsolatedApp(custom_options) as app:
         test(app, *args, **kwargs)
Exemple #25
0
 def Wrapper(*args, **kwargs):
     with IsolatedApp(custom_options) as app:
         try:
             test(app, *args, **kwargs)
         finally:
             StopCompleterServer(app, 'typescript')
Exemple #26
0
 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)
Exemple #27
0
 def manager( custom_options = {} ):
   with IsolatedApp( custom_options ) as app:
     try:
       yield app
     finally:
       StopCompleterServer( app, 'java' )
Exemple #28
0
 def Wrapper(test_case_instance, *args, **kwargs):
     with IsolatedApp(custom_options) as app:
         test(test_case_instance, app, *args, **kwargs)
Exemple #29
0
 def Wrapper(*args, **kwargs):
     custom_options.update({'use_clangd': 0})
     with IsolatedApp(custom_options) as app:
         test(app, *args, **kwargs)