From f31102e31789b560e7b09ff2aa1ceb18134eeb76 Mon Sep 17 00:00:00 2001 From: micbou Date: Mon, 3 Jul 2017 18:06:01 +0200 Subject: [PATCH] Check if server is ready before running tests --- python/ycm/tests/__init__.py | 1 + python/ycm/tests/event_notification_test.py | 11 +---------- python/ycm/tests/youcompleteme_test.py | 6 ------ 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/python/ycm/tests/__init__.py b/python/ycm/tests/__init__.py index 325b4208..76cc7280 100644 --- a/python/ycm/tests/__init__.py +++ b/python/ycm/tests/__init__.py @@ -110,6 +110,7 @@ def YouCompleteMeInstance( custom_options = {} ): def Wrapper( *args, **kwargs ): ycm = YouCompleteMe( _MakeUserOptions( custom_options ) ) WaitUntilReady() + ycm.CheckIfServerIsReady() try: test( ycm, *args, **kwargs ) finally: diff --git a/python/ycm/tests/event_notification_test.py b/python/ycm/tests/event_notification_test.py index 6c4bebdf..9ce63b94 100644 --- a/python/ycm/tests/event_notification_test.py +++ b/python/ycm/tests/event_notification_test.py @@ -105,10 +105,7 @@ def MockEventNotification( response_method, native_filetype_completer = True ): 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype', return_value = native_filetype_completer ): - with patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady', - return_value = True ): - - yield + yield @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.IsServerReady', - return_value = True ) @YouCompleteMeInstance( { 'collect_identifiers_from_tags_files': 1 } ) def EventNotification_FileReadyToParse_TagFiles_UnicodeWorkingDirectory_test( ycm, *args ): @@ -498,8 +493,6 @@ def EventNotification_BufferUnload_BuildRequestForDeletedAndUnsavedBuffers_test( @patch( 'ycm.syntax_parse.SyntaxKeywordsForCurrentBuffer', return_value = [ 'foo', 'bar' ] ) -@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady', - return_value = True ) @YouCompleteMeInstance( { 'seed_identifiers_with_syntax': 1 } ) def EventNotification_FileReadyToParse_SyntaxKeywords_SeedWithCache_test( ycm, *args ): @@ -534,8 +527,6 @@ def EventNotification_FileReadyToParse_SyntaxKeywords_SeedWithCache_test( @patch( 'ycm.syntax_parse.SyntaxKeywordsForCurrentBuffer', return_value = [ 'foo', 'bar' ] ) -@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady', - return_value = True ) @YouCompleteMeInstance( { 'seed_identifiers_with_syntax': 1 } ) def EventNotification_FileReadyToParse_SyntaxKeywords_ClearCacheIfRestart_test( ycm, *args ): diff --git a/python/ycm/tests/youcompleteme_test.py b/python/ycm/tests/youcompleteme_test.py index ebdfbc7a..dcc2d100 100644 --- a/python/ycm/tests/youcompleteme_test.py +++ b/python/ycm/tests/youcompleteme_test.py @@ -349,8 +349,6 @@ def YouCompleteMe_ShowDiagnostics_NoDiagnosticsDetected_test( 'open_loclist_on_ycm_diags': 0 } ) @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype', return_value = True ) -@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady', - return_value = True ) @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock ) @patch( 'ycm.vimsupport.SetLocationList', new_callable = ExtendedMock ) def YouCompleteMe_ShowDiagnostics_DiagnosticsFound_DoNotOpenLocationList_test( @@ -390,8 +388,6 @@ def YouCompleteMe_ShowDiagnostics_DiagnosticsFound_DoNotOpenLocationList_test( @YouCompleteMeInstance( { 'open_loclist_on_ycm_diags': 1 } ) @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype', return_value = True ) -@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady', - return_value = True ) @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock ) @patch( 'ycm.vimsupport.SetLocationList', new_callable = ExtendedMock ) @patch( 'ycm.vimsupport.OpenLocationList', new_callable = ExtendedMock ) @@ -435,8 +431,6 @@ def YouCompleteMe_ShowDiagnostics_DiagnosticsFound_OpenLocationList_test( 'enable_diagnostic_highlighting': 1 } ) @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype', return_value = True ) -@patch( 'ycm.youcompleteme.YouCompleteMe.IsServerReady', - return_value = True ) @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock ) @patch( 'vim.command', new_callable = ExtendedMock ) def YouCompleteMe_UpdateDiagnosticInterface_PrioritizeErrorsOverWarnings_test(