diff --git a/test/plugins/test_pylint_lint.py b/test/plugins/test_pylint_lint.py index 5b5b99cb..f6fcda8a 100644 --- a/test/plugins/test_pylint_lint.py +++ b/test/plugins/test_pylint_lint.py @@ -4,6 +4,7 @@ import contextlib import os +import sys import tempfile from test import py2_only, py3_only, IS_PY3 @@ -71,7 +72,10 @@ def test_syntax_error_pylint_py3(config, workspace): with temp_document(DOC_SYNTAX_ERR, workspace) as doc: diag = pylint_lint.pylsp_lint(config, doc, True)[0] - assert diag['message'].startswith('[syntax-error] invalid syntax') + if sys.version_info[:2] >= (3, 10): + assert diag['message'].count("[syntax-error] expected ':'") + else: + assert diag['message'].startswith('[syntax-error] invalid syntax') # Pylint doesn't give column numbers for invalid syntax. assert diag['range']['start'] == {'line': 0, 'character': 12} assert diag['severity'] == lsp.DiagnosticSeverity.Error