Skip to content

Commit 2e06283

Browse files
authored
Fix another test with Python 3.10 (#112)
1 parent 2803934 commit 2e06283

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/plugins/test_pylint_lint.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import contextlib
66
import os
7+
import sys
78
import tempfile
89

910
from test import py2_only, py3_only, IS_PY3
@@ -71,7 +72,10 @@ def test_syntax_error_pylint_py3(config, workspace):
7172
with temp_document(DOC_SYNTAX_ERR, workspace) as doc:
7273
diag = pylint_lint.pylsp_lint(config, doc, True)[0]
7374

74-
assert diag['message'].startswith('[syntax-error] invalid syntax')
75+
if sys.version_info[:2] >= (3, 10):
76+
assert diag['message'].count("[syntax-error] expected ':'")
77+
else:
78+
assert diag['message'].startswith('[syntax-error] invalid syntax')
7579
# Pylint doesn't give column numbers for invalid syntax.
7680
assert diag['range']['start'] == {'line': 0, 'character': 12}
7781
assert diag['severity'] == lsp.DiagnosticSeverity.Error

0 commit comments

Comments
 (0)