7
7
import sys
8
8
import tempfile
9
9
10
- from test import py2_only , py3_only , IS_PY3
11
10
from pylsp import lsp , uris
12
11
from pylsp .workspace import Document
13
12
from pylsp .plugins import pylint_lint
@@ -53,23 +52,21 @@ def test_pylint(config, workspace):
53
52
assert unused_import ['severity' ] == lsp .DiagnosticSeverity .Warning
54
53
assert unused_import ['tags' ] == [lsp .DiagnosticTag .Unnecessary ]
55
54
56
- if IS_PY3 :
57
- # test running pylint in stdin
58
- config .plugin_settings ('pylint' )['executable' ] = 'pylint'
59
- diags = pylint_lint .pylsp_lint (config , doc , True )
55
+ # test running pylint in stdin
56
+ config .plugin_settings ('pylint' )['executable' ] = 'pylint'
57
+ diags = pylint_lint .pylsp_lint (config , doc , True )
60
58
61
- msg = 'Unused import sys (unused-import)'
62
- unused_import = [d for d in diags if d ['message' ] == msg ][0 ]
59
+ msg = 'Unused import sys (unused-import)'
60
+ unused_import = [d for d in diags if d ['message' ] == msg ][0 ]
63
61
64
- assert unused_import ['range' ]['start' ] == {
65
- 'line' : 0 ,
66
- 'character' : 0 ,
67
- }
68
- assert unused_import ['severity' ] == lsp .DiagnosticSeverity .Warning
62
+ assert unused_import ['range' ]['start' ] == {
63
+ 'line' : 0 ,
64
+ 'character' : 0 ,
65
+ }
66
+ assert unused_import ['severity' ] == lsp .DiagnosticSeverity .Warning
69
67
70
68
71
- @py3_only
72
- def test_syntax_error_pylint_py3 (config , workspace ):
69
+ def test_syntax_error_pylint (config , workspace ):
73
70
with temp_document (DOC_SYNTAX_ERR , workspace ) as doc :
74
71
diag = pylint_lint .pylsp_lint (config , doc , True )[0 ]
75
72
@@ -92,17 +89,6 @@ def test_syntax_error_pylint_py3(config, workspace):
92
89
assert diag ['severity' ] == lsp .DiagnosticSeverity .Error
93
90
94
91
95
- @py2_only
96
- def test_syntax_error_pylint_py2 (config , workspace ):
97
- with temp_document (DOC_SYNTAX_ERR , workspace ) as doc :
98
- diag = pylint_lint .pylsp_lint (config , doc , True )[0 ]
99
-
100
- assert diag ['message' ].startswith ('[syntax-error] invalid syntax' )
101
- # Pylint doesn't give column numbers for invalid syntax.
102
- assert diag ['range' ]['start' ] == {'line' : 0 , 'character' : 0 }
103
- assert diag ['severity' ] == lsp .DiagnosticSeverity .Error
104
-
105
-
106
92
def test_lint_free_pylint (config , workspace ):
107
93
# Can't use temp_document because it might give us a file that doesn't
108
94
# match pylint's naming requirements. We should be keeping this file clean
0 commit comments