Check if server is ready before running tests
This commit is contained in:
parent
25a2e3120c
commit
f31102e317
@ -110,6 +110,7 @@ def YouCompleteMeInstance( custom_options = {} ):
|
|||||||
def Wrapper( *args, **kwargs ):
|
def Wrapper( *args, **kwargs ):
|
||||||
ycm = YouCompleteMe( _MakeUserOptions( custom_options ) )
|
ycm = YouCompleteMe( _MakeUserOptions( custom_options ) )
|
||||||
WaitUntilReady()
|
WaitUntilReady()
|
||||||
|
ycm.CheckIfServerIsReady()
|
||||||
try:
|
try:
|
||||||
test( ycm, *args, **kwargs )
|
test( ycm, *args, **kwargs )
|
||||||
finally:
|
finally:
|
||||||
|
@ -105,10 +105,7 @@ def MockEventNotification( response_method, native_filetype_completer = True ):
|
|||||||
'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
||||||
return_value = native_filetype_completer ):
|
return_value = native_filetype_completer ):
|
||||||
|
|
||||||
with patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady',
|
yield
|
||||||
return_value = True ):
|
|
||||||
|
|
||||||
yield
|
|
||||||
|
|
||||||
|
|
||||||
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
||||||
@ -352,8 +349,6 @@ def _Check_FileReadyToParse_Diagnostic_Clean( ycm, vim_command ):
|
|||||||
|
|
||||||
|
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe._AddUltiSnipsDataIfNeeded' )
|
@patch( 'ycm.youcompleteme.YouCompleteMe._AddUltiSnipsDataIfNeeded' )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady',
|
|
||||||
return_value = True )
|
|
||||||
@YouCompleteMeInstance( { 'collect_identifiers_from_tags_files': 1 } )
|
@YouCompleteMeInstance( { 'collect_identifiers_from_tags_files': 1 } )
|
||||||
def EventNotification_FileReadyToParse_TagFiles_UnicodeWorkingDirectory_test(
|
def EventNotification_FileReadyToParse_TagFiles_UnicodeWorkingDirectory_test(
|
||||||
ycm, *args ):
|
ycm, *args ):
|
||||||
@ -498,8 +493,6 @@ def EventNotification_BufferUnload_BuildRequestForDeletedAndUnsavedBuffers_test(
|
|||||||
|
|
||||||
@patch( 'ycm.syntax_parse.SyntaxKeywordsForCurrentBuffer',
|
@patch( 'ycm.syntax_parse.SyntaxKeywordsForCurrentBuffer',
|
||||||
return_value = [ 'foo', 'bar' ] )
|
return_value = [ 'foo', 'bar' ] )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady',
|
|
||||||
return_value = True )
|
|
||||||
@YouCompleteMeInstance( { 'seed_identifiers_with_syntax': 1 } )
|
@YouCompleteMeInstance( { 'seed_identifiers_with_syntax': 1 } )
|
||||||
def EventNotification_FileReadyToParse_SyntaxKeywords_SeedWithCache_test(
|
def EventNotification_FileReadyToParse_SyntaxKeywords_SeedWithCache_test(
|
||||||
ycm, *args ):
|
ycm, *args ):
|
||||||
@ -534,8 +527,6 @@ def EventNotification_FileReadyToParse_SyntaxKeywords_SeedWithCache_test(
|
|||||||
|
|
||||||
@patch( 'ycm.syntax_parse.SyntaxKeywordsForCurrentBuffer',
|
@patch( 'ycm.syntax_parse.SyntaxKeywordsForCurrentBuffer',
|
||||||
return_value = [ 'foo', 'bar' ] )
|
return_value = [ 'foo', 'bar' ] )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady',
|
|
||||||
return_value = True )
|
|
||||||
@YouCompleteMeInstance( { 'seed_identifiers_with_syntax': 1 } )
|
@YouCompleteMeInstance( { 'seed_identifiers_with_syntax': 1 } )
|
||||||
def EventNotification_FileReadyToParse_SyntaxKeywords_ClearCacheIfRestart_test(
|
def EventNotification_FileReadyToParse_SyntaxKeywords_ClearCacheIfRestart_test(
|
||||||
ycm, *args ):
|
ycm, *args ):
|
||||||
|
@ -349,8 +349,6 @@ def YouCompleteMe_ShowDiagnostics_NoDiagnosticsDetected_test(
|
|||||||
'open_loclist_on_ycm_diags': 0 } )
|
'open_loclist_on_ycm_diags': 0 } )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
@patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
||||||
return_value = True )
|
return_value = True )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady',
|
|
||||||
return_value = True )
|
|
||||||
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
||||||
@patch( 'ycm.vimsupport.SetLocationList', new_callable = ExtendedMock )
|
@patch( 'ycm.vimsupport.SetLocationList', new_callable = ExtendedMock )
|
||||||
def YouCompleteMe_ShowDiagnostics_DiagnosticsFound_DoNotOpenLocationList_test(
|
def YouCompleteMe_ShowDiagnostics_DiagnosticsFound_DoNotOpenLocationList_test(
|
||||||
@ -390,8 +388,6 @@ def YouCompleteMe_ShowDiagnostics_DiagnosticsFound_DoNotOpenLocationList_test(
|
|||||||
@YouCompleteMeInstance( { 'open_loclist_on_ycm_diags': 1 } )
|
@YouCompleteMeInstance( { 'open_loclist_on_ycm_diags': 1 } )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
@patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
||||||
return_value = True )
|
return_value = True )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady',
|
|
||||||
return_value = True )
|
|
||||||
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
||||||
@patch( 'ycm.vimsupport.SetLocationList', new_callable = ExtendedMock )
|
@patch( 'ycm.vimsupport.SetLocationList', new_callable = ExtendedMock )
|
||||||
@patch( 'ycm.vimsupport.OpenLocationList', new_callable = ExtendedMock )
|
@patch( 'ycm.vimsupport.OpenLocationList', new_callable = ExtendedMock )
|
||||||
@ -435,8 +431,6 @@ def YouCompleteMe_ShowDiagnostics_DiagnosticsFound_OpenLocationList_test(
|
|||||||
'enable_diagnostic_highlighting': 1 } )
|
'enable_diagnostic_highlighting': 1 } )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
@patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
||||||
return_value = True )
|
return_value = True )
|
||||||
@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady',
|
|
||||||
return_value = True )
|
|
||||||
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
||||||
@patch( 'vim.command', new_callable = ExtendedMock )
|
@patch( 'vim.command', new_callable = ExtendedMock )
|
||||||
def YouCompleteMe_UpdateDiagnosticInterface_PrioritizeErrorsOverWarnings_test(
|
def YouCompleteMe_UpdateDiagnosticInterface_PrioritizeErrorsOverWarnings_test(
|
||||||
|
Loading…
Reference in New Issue
Block a user