|
1 | 1 | #!/usr/bin/env python3
|
2 | 2 | # pragma pylint: disable=too-many-lines
|
3 | 3 | # test line 1
|
| 4 | +from __future__ import annotations # See: https://github.com/PyCQA/pylint/issues/3320 |
4 | 5 | import argparse
|
5 | 6 | import fnmatch
|
6 | 7 | import functools
|
@@ -422,7 +423,7 @@ def parse(self):
|
422 | 423 | self.next_line()
|
423 | 424 |
|
424 | 425 |
|
425 |
| - def parseDiagnostics(self) -> Diagnostics: |
| 426 | + def parseDiagnostics(self) -> TestParser.Diagnostics: |
426 | 427 | """
|
427 | 428 | Parse diagnostic expectations specified in the file.
|
428 | 429 | Returns a named tuple instance of "Diagnostics"
|
@@ -454,7 +455,7 @@ def parseDiagnostics(self) -> Diagnostics:
|
454 | 455 | return self.Diagnostics(**diagnostics)
|
455 | 456 |
|
456 | 457 |
|
457 |
| - def parseRequestAndResponse(self) -> RequestAndResponse: |
| 458 | + def parseRequestAndResponse(self) -> TestParser.RequestAndResponse: |
458 | 459 | RESPONSE_START = "// <- "
|
459 | 460 | REQUEST_END = "// }"
|
460 | 461 | COMMENT_PREFIX = "// "
|
@@ -915,7 +916,7 @@ def setup_lsp(
|
915 | 916 | lsp: JsonRpcProcess,
|
916 | 917 | expose_project_root=True,
|
917 | 918 | file_load_strategy: FileLoadStrategy=FileLoadStrategy.DirectlyOpenedAndOnImport,
|
918 |
| - custom_include_paths: list[str] = [], |
| 919 | + custom_include_paths: list[str] = None, |
919 | 920 | project_root_subdir=None
|
920 | 921 | ):
|
921 | 922 | """
|
@@ -950,7 +951,7 @@ def setup_lsp(
|
950 | 951 | params['initializationOptions'] = {}
|
951 | 952 | params['initializationOptions']['file-load-strategy'] = file_load_strategy.lsp_name()
|
952 | 953 |
|
953 |
| - if len(custom_include_paths) != 0: |
| 954 | + if custom_include_paths is not None and len(custom_include_paths) != 0: |
954 | 955 | if params['initializationOptions'] is None:
|
955 | 956 | params['initializationOptions'] = {}
|
956 | 957 | params['initializationOptions']['include-paths'] = custom_include_paths
|
@@ -1412,7 +1413,11 @@ def test_analyze_all_project_files3(self, solc: JsonRpcProcess) -> None:
|
1412 | 1413 | custom_include_paths=[f"{self.project_root_dir}/other-include-dir"]
|
1413 | 1414 | )
|
1414 | 1415 | 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 | + ) |
1416 | 1421 |
|
1417 | 1422 | # All but the last report should be from expected files
|
1418 | 1423 | for report in published_diagnostics[:-IMPLICITLY_LOADED_FILE_COUNT]:
|
|
0 commit comments