Skip to content

Commit

Permalink
Fix another test with Python 3.10 (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
jspricke authored Nov 6, 2021
1 parent 2803934 commit 2e06283
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/plugins/test_pylint_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import contextlib
import os
import sys
import tempfile

from test import py2_only, py3_only, IS_PY3
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2e06283

Please sign in to comment.