Skip to content

Commit

Permalink
Fix test with Python 3.10 (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
jspricke committed Nov 5, 2021
1 parent e46cddd commit 2803934
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/plugins/test_pyflakes_lint.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.

import sys

from pylsp import lsp, uris
from pylsp.workspace import Document
from pylsp.plugins import pyflakes_lint
Expand Down Expand Up @@ -42,7 +44,10 @@ def test_syntax_error_pyflakes(workspace):
doc = Document(DOC_URI, workspace, DOC_SYNTAX_ERR)
diag = pyflakes_lint.pylsp_lint(doc)[0]

assert diag['message'] == 'invalid syntax'
if sys.version_info[:2] >= (3, 10):
assert diag['message'] == "expected ':'"
else:
assert diag['message'] == 'invalid syntax'
assert diag['range']['start'] == {'line': 0, 'character': 12}
assert diag['severity'] == lsp.DiagnosticSeverity.Error

Expand Down

0 comments on commit 2803934

Please sign in to comment.