Exemplo n.º 1
0
    def Wrapper(*args, **kwargs):
        old_server_state = handlers._server_state

        try:
            app = SetUpApp()
            app.post_json("/ignore_extra_conf_file", {"filepath": PathToTestFile(".ycm_extra_conf.py")})
            test(app, *args, **kwargs)
        finally:
            handlers._server_state = old_server_state
Exemplo n.º 2
0
def setUpPackage():
    """Initializes the ycmd server as a WebTest application that will be shared
  by all tests using the SharedYcmd decorator in this package. Additional
  configuration that is common to these tests, like starting a semantic
  subserver, should be done here."""
    global shared_app

    shared_app = SetUpApp()
    shared_app.post_json("/ignore_extra_conf_file", {"filepath": PathToTestFile(".ycm_extra_conf.py")})
Exemplo n.º 3
0
    def Wrapper(*args, **kwargs):
        old_server_state = handlers._server_state

        try:
            app = SetUpApp()
            app.post_json('/ignore_extra_conf_file',
                          {'filepath': PathToTestFile('.ycm_extra_conf.py')})
            test(app, *args, **kwargs)
        finally:
            handlers._server_state = old_server_state
Exemplo n.º 4
0
 def Wrapper( *args, **kwargs ):
   old_server_state = handlers._server_state
   app = SetUpApp( custom_options )
   try:
     app.post_json(
       '/ignore_extra_conf_file',
       { 'filepath': PathToTestFile( '.ycm_extra_conf.py' ) } )
     test( app, *args, **kwargs )
   finally:
     handlers._server_state = old_server_state
Exemplo n.º 5
0
def setUpPackage():
    """Initializes the ycmd server as a WebTest application that will be shared
  by all tests using the SharedYcmd decorator in this package. Additional
  configuration that is common to these tests, like starting a semantic
  subserver, should be done here."""
    global shared_app

    shared_app = SetUpApp()
    shared_app.post_json('/ignore_extra_conf_file',
                         {'filepath': PathToTestFile('.ycm_extra_conf.py')})
Exemplo n.º 6
0
    def Wrapper(*args, **kwargs):
        old_server_state = handlers._server_state

        try:
            test(SetUpApp(), *args, **kwargs)
        finally:
            handlers._server_state = old_server_state
Exemplo n.º 7
0
 def Wrapper( *args, **kwargs ):
   old_server_state = handlers._server_state
   app = SetUpApp( custom_options )
   try:
     test( app, *args, **kwargs )
   finally:
     handlers._server_state = old_server_state
Exemplo n.º 8
0
def set_up_shared_app():
    global shared_app
    shared_app = SetUpApp()
    with IgnoreExtraConfOutsideTestsFolder():
        StartGoCompleterServerInDirectory(shared_app, PathToTestFile())
    yield
    StopCompleterServer(shared_app, 'go')
Exemplo n.º 9
0
def setUpModule():
    global shared_app
    with patch('ycmd.completers.javascript.hook.'
               'ShouldEnableTernCompleter',
               return_value=False):
        shared_app = SetUpApp()
        WaitUntilCompleterServerReady(shared_app, 'javascriptreact')
Exemplo n.º 10
0
def setup_module():
    """Initializes the ycmd server as a WebTest application that will be shared
  by all tests using the SharedYcmd decorator in this package. Additional
  configuration that is common to these tests, like starting a semantic
  subserver, should be done here."""
    global shared_app
    shared_app = SetUpApp()
    StartJavaScriptCompleterServerInDirectory(shared_app, PathToTestFile())
Exemplo n.º 11
0
 def Wrapper(*args, **kwargs):
     old_server_state = handlers._server_state
     app = SetUpApp(custom_options)
     try:
         test(app, *args, **kwargs)
     finally:
         StopCompleterServer(app, 'rust')
         handlers._server_state = old_server_state
Exemplo n.º 12
0
def set_up_shared_app():
    global shared_app
    shared_app = SetUpApp()
    with IgnoreExtraConfOutsideTestsFolder():
        StartRustCompleterServerInDirectory(shared_app,
                                            PathToTestFile('common', 'src'))
    yield
    StopCompleterServer(shared_app, 'rust')
Exemplo n.º 13
0
 def Wrapper( *args, **kwargs ):
   old_server_state = handlers._server_state
   app = SetUpApp()
   try:
     test( app, *args, **kwargs )
   finally:
     StopCompleterServer( app, 'typescript' )
     handlers._server_state = old_server_state
Exemplo n.º 14
0
def setUpPackage():
    """Initializes the ycmd server as a WebTest application that will be shared
  by all tests using the SharedYcmd decorator in this package. Additional
  configuration that is common to these tests, like starting a semantic
  subserver, should be done here."""
    global shared_app

    shared_app = SetUpApp()
Exemplo n.º 15
0
 def Wrapper(*args, **kwargs):
     old_server_state = handlers._server_state
     app = SetUpApp()
     try:
         with CurrentWorkingDirectory(directory):
             test(app, *args, **kwargs)
     finally:
         StopCompleterServer(app, 'javascript')
         handlers._server_state = old_server_state
Exemplo n.º 16
0
def SharedYcmd( test ):
  global shared_app
  if shared_app is None:
    shared_app = SetUpApp()

  @functools.wraps( test )
  def Wrapper( test_case_instance, *args, **kwargs ):
    ClearCompletionsCache()
    return test( test_case_instance, shared_app, *args, **kwargs )
  return Wrapper
Exemplo n.º 17
0
    def Wrapper(*args, **kwargs):
        old_server_state = handlers._server_state

        try:
            app = SetUpApp()
            WaitUntilRacerdServerReady(app)
            test(app, *args, **kwargs)
            StopRacerdServer(app)
        finally:
            handlers._server_state = old_server_state
Exemplo n.º 18
0
def setUpPackage():
    """Initializes the ycmd server as a WebTest application that will be shared
  by all tests using the SharedYcmd decorator in this package. Additional
  configuration that is common to these tests, like starting a semantic
  subserver, should be done here."""
    global shared_app

    shared_app = SetUpApp()
    with IgnoreExtraConfOutsideTestsFolder():
        StartGoCompleterServerInDirectory(shared_app, PathToTestFile())
Exemplo n.º 19
0
 def Wrapper(*args, **kwargs):
     old_server_state = handlers._server_state
     old_current_dir = os.getcwd()
     app = SetUpApp()
     os.chdir(PathToTestFile())
     try:
         test(app, *args, **kwargs)
     finally:
         StopCompleterServer(app, 'javascript')
         os.chdir(old_current_dir)
         handlers._server_state = old_server_state
Exemplo n.º 20
0
def setUpPackage():
    """Initializes the ycmd server as a WebTest application that will be shared
  by all tests using the SharedYcmd decorator in this package. Additional
  configuration that is common to these tests, like starting a semantic
  subserver, should be done here."""
    global shared_app, shared_current_dir

    shared_app = SetUpApp()
    shared_current_dir = GetCurrentDirectory()
    os.chdir(PathToTestFile())
    WaitUntilCompleterServerReady(shared_app, 'javascript')
Exemplo n.º 21
0
def setUpPackage():
  """Initializes the ycmd server as a WebTest application that will be shared
  by all tests using the SharedYcmd decorator in this package. Additional
  configuration that is common to these tests, like starting a semantic
  subserver, should be done here."""
  global shared_app

  with patch( 'ycmd.completers.javascript.hook.'
              'ShouldEnableTernCompleter', return_value = False ):
    shared_app = SetUpApp()
    WaitUntilCompleterServerReady( shared_app, 'javascript' )
Exemplo n.º 22
0
def setUpPackage():
  """Initializes the ycmd server as a WebTest application that will be shared
  by all tests using the SharedYcmd decorator in this package. Additional
  configuration that is common to these tests, like starting a semantic
  subserver, should be done here."""
  global shared_app

  shared_app = SetUpApp()
  # By default, we use the eclipse project for convenience. This means we don't
  # have to @IsolatedYcmdInDirectory( DEFAULT_PROJECT_DIR ) for every test
  StartJavaCompleterServerInDirectory( shared_app,
                                       PathToTestFile( DEFAULT_PROJECT_DIR ) )
Exemplo n.º 23
0
  def Wrapper( *args, **kwargs ):
    old_server_state = handlers._server_state
    old_current_dir = os.getcwd()

    try:
      os.chdir( PathToTestFile() )
      app = SetUpApp()
      WaitUntilTernServerReady( app )
      test( app, *args, **kwargs )
      StopTernServer( app )
    finally:
      os.chdir( old_current_dir )
      handlers._server_state = old_server_state
Exemplo n.º 24
0
def set_up_shared_app():
    global shared_app
    shared_app = SetUpApp()
Exemplo n.º 25
0
def setUpModule():
    global shared_app
    shared_app = SetUpApp()
Exemplo n.º 26
0
def set_up_shared_app():
    global shared_app
    shared_app = SetUpApp()
    yield
    StopCompleterServer(shared_app, 'cpp')
Exemplo n.º 27
0
def set_up_shared_app():
    global shared_app
    shared_app = SetUpApp({'use_clangd': 0})
Exemplo n.º 28
0
def setUpModule():
    global shared_app
    shared_app = SetUpApp()
    StartJavaScriptCompleterServerInDirectory(shared_app, PathToTestFile())
Exemplo n.º 29
0
def setUpModule():
    global shared_app
    shared_app = SetUpApp()
    with IgnoreExtraConfOutsideTestsFolder():
        StartRustCompleterServerInDirectory(shared_app,
                                            PathToTestFile('common'))
Exemplo n.º 30
0
def set_up_shared_app():
    global shared_app, shared_filepaths
    shared_app = SetUpApp()
    yield
    for filepath in shared_filepaths.get(shared_app, []):
        StopCompleterServer(shared_app, 'cs', filepath)
Exemplo n.º 31
0
def setUpModule():
    global shared_app
    shared_app = SetUpApp({'use_clangd': 0})
Exemplo n.º 32
0
def setUpModule():
    global shared_app
    shared_app = SetUpApp()
    with IgnoreExtraConfOutsideTestsFolder():
        StartJavaCompleterServerInDirectory(
            shared_app, PathToTestFile(DEFAULT_PROJECT_DIR))
Exemplo n.º 33
0
def setup_module():
  global shared_app, shared_filepaths
  shared_app = SetUpApp()