Skip to content

Commit d0854cb

Browse files
Applying CI-reported fixes.
1 parent d31e4dc commit d0854cb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/lsp.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22
# pragma pylint: disable=too-many-lines
33
# test line 1
4+
from __future__ import annotations # See: https://github.com/PyCQA/pylint/issues/3320
45
import argparse
56
import fnmatch
67
import functools
@@ -422,7 +423,7 @@ def parse(self):
422423
self.next_line()
423424

424425

425-
def parseDiagnostics(self) -> Diagnostics:
426+
def parseDiagnostics(self) -> TestParser.Diagnostics:
426427
"""
427428
Parse diagnostic expectations specified in the file.
428429
Returns a named tuple instance of "Diagnostics"
@@ -454,7 +455,7 @@ def parseDiagnostics(self) -> Diagnostics:
454455
return self.Diagnostics(**diagnostics)
455456

456457

457-
def parseRequestAndResponse(self) -> RequestAndResponse:
458+
def parseRequestAndResponse(self) -> TestParser.RequestAndResponse:
458459
RESPONSE_START = "// <- "
459460
REQUEST_END = "// }"
460461
COMMENT_PREFIX = "// "
@@ -915,7 +916,7 @@ def setup_lsp(
915916
lsp: JsonRpcProcess,
916917
expose_project_root=True,
917918
file_load_strategy: FileLoadStrategy=FileLoadStrategy.DirectlyOpenedAndOnImport,
918-
custom_include_paths: list[str] = [],
919+
custom_include_paths: list[str] = None,
919920
project_root_subdir=None
920921
):
921922
"""
@@ -950,7 +951,7 @@ def setup_lsp(
950951
params['initializationOptions'] = {}
951952
params['initializationOptions']['file-load-strategy'] = file_load_strategy.lsp_name()
952953

953-
if len(custom_include_paths) != 0:
954+
if custom_include_paths is not None and len(custom_include_paths) != 0:
954955
if params['initializationOptions'] is None:
955956
params['initializationOptions'] = {}
956957
params['initializationOptions']['include-paths'] = custom_include_paths
@@ -1412,7 +1413,11 @@ def test_analyze_all_project_files3(self, solc: JsonRpcProcess) -> None:
14121413
custom_include_paths=[f"{self.project_root_dir}/other-include-dir"]
14131414
)
14141415
published_diagnostics = self.wait_for_diagnostics(solc)
1415-
self.expect_equal(len(published_diagnostics), len(EXPECTED_FILES) + IMPLICITLY_LOADED_FILE_COUNT, "Test number of files analyzed.")
1416+
self.expect_equal(
1417+
len(published_diagnostics),
1418+
len(EXPECTED_FILES) + IMPLICITLY_LOADED_FILE_COUNT,
1419+
"Test number of files analyzed."
1420+
)
14161421

14171422
# All but the last report should be from expected files
14181423
for report in published_diagnostics[:-IMPLICITLY_LOADED_FILE_COUNT]:

0 commit comments

Comments
 (0)