|
3 | 3 |
|
4 | 4 | from io import StringIO
|
5 | 5 | from os import getcwd, linesep, sep
|
6 |
| -from typing import Dict, List, Optional |
| 6 | +from typing import TYPE_CHECKING, Dict, List, Optional |
7 | 7 |
|
8 | 8 | from pylint import interfaces
|
9 | 9 | from pylint.message import Message
|
10 | 10 | from pylint.reporters import BaseReporter
|
11 | 11 |
|
| 12 | +if TYPE_CHECKING: |
| 13 | + from pylint.reporters.ureports.nodes import Section |
| 14 | + |
12 | 15 |
|
13 | 16 | class GenericTestReporter(BaseReporter):
|
14 | 17 | """reporter storing plain text messages"""
|
@@ -56,25 +59,27 @@ def on_set_current_module(self, module: str, filepath: Optional[str]) -> None:
|
56 | 59 |
|
57 | 60 | # pylint: enable=unused-argument
|
58 | 61 |
|
59 |
| - def display_reports(self, layout): |
| 62 | + def display_reports(self, layout: "Section") -> None: |
60 | 63 | """ignore layouts"""
|
61 | 64 |
|
62 |
| - _display = None |
| 65 | + def _display(self, layout: "Section") -> None: |
| 66 | + pass |
63 | 67 |
|
64 | 68 |
|
65 | 69 | class MinimalTestReporter(BaseReporter):
|
66 | 70 | def on_set_current_module(self, module: str, filepath: Optional[str]) -> None:
|
67 | 71 | self.messages = []
|
68 | 72 |
|
69 |
| - _display = None |
| 73 | + def _display(self, layout: "Section") -> None: |
| 74 | + pass |
70 | 75 |
|
71 | 76 |
|
72 | 77 | class FunctionalTestReporter(BaseReporter):
|
73 | 78 | def on_set_current_module(self, module: str, filepath: Optional[str]) -> None:
|
74 | 79 | self.messages = []
|
75 | 80 |
|
76 |
| - def display_reports(self, layout): |
| 81 | + def display_reports(self, layout: "Section") -> None: |
77 | 82 | """Ignore layouts and don't call self._display()."""
|
78 | 83 |
|
79 |
| - def _display(self, layout): |
| 84 | + def _display(self, layout: "Section") -> None: |
80 | 85 | pass
|
0 commit comments