14
14
from pylsp .python_lsp import start_io_lang_server , PythonLSPServer
15
15
16
16
CALL_TIMEOUT = 10
17
- PY2 = sys .version_info [0 ] == 2
18
- PY3 = sys .version_info [0 ] == 3
17
+ RUNNING_IN_CI = bool (os .environ .get ('CI' ))
19
18
20
19
21
20
def start_client (client ):
@@ -87,8 +86,7 @@ def test_initialize(client_server): # pylint: disable=redefined-outer-name
87
86
88
87
89
88
@flaky (max_runs = 10 , min_passes = 1 )
90
- @pytest .mark .skipif (os .name == 'nt' or (sys .platform .startswith ('linux' ) and PY3 ),
91
- reason = 'Skipped on win and fails on linux >=3.6' )
89
+ @pytest .mark .skipif (not sys .platform .startswith ('Linux' ), reason = 'Skipped on win and flaky on mac' )
92
90
def test_exit_with_parent_process_died (client_exited_server ): # pylint: disable=redefined-outer-name
93
91
# language server should have already exited before responding
94
92
lsp_server , mock_process = client_exited_server .client , client_exited_server .process
@@ -104,8 +102,7 @@ def test_exit_with_parent_process_died(client_exited_server): # pylint: disable
104
102
assert not client_exited_server .client_thread .is_alive ()
105
103
106
104
107
- @pytest .mark .skipif (sys .platform .startswith ('linux' ) and PY3 ,
108
- reason = 'Fails on linux and py3' )
105
+ @pytest .mark .skipif (sys .platform .startswith ('linux' ), reason = 'Fails on linux' )
109
106
def test_not_exit_without_check_parent_process_flag (client_server ): # pylint: disable=redefined-outer-name
110
107
response = client_server ._endpoint .request ('initialize' , {
111
108
'processId' : 1234 ,
@@ -115,7 +112,7 @@ def test_not_exit_without_check_parent_process_flag(client_server): # pylint: d
115
112
assert 'capabilities' in response
116
113
117
114
118
- @pytest .mark .skipif (bool ( os . environ . get ( 'CI' )) , reason = 'This test is hanging on CI' )
115
+ @pytest .mark .skipif (RUNNING_IN_CI , reason = 'This test is hanging on CI' )
119
116
def test_missing_message (client_server ): # pylint: disable=redefined-outer-name
120
117
with pytest .raises (JsonRpcMethodNotFound ):
121
118
client_server ._endpoint .request ('unknown_method' ).result (timeout = CALL_TIMEOUT )
0 commit comments