Skip to content

Commit ca06014

Browse files
authored
Add typing to some functions in testutils (#5573)
1 parent feabd3d commit ca06014

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

pylint/testutils/configuration_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
def get_expected_or_default(
3131
tested_configuration_file: Union[str, Path],
3232
suffix: str,
33-
default: ConfigurationValue,
33+
default: str,
3434
) -> str:
3535
"""Return the expected value from the file if it exists, or the given default."""
3636
expected = default

pylint/testutils/functional/test_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import configparser
55
import sys
66
from os.path import basename, exists, join
7-
from typing import List, Tuple
7+
from typing import Callable, Dict, List, Tuple, Union
88

99

1010
def parse_python_version(ver_str: str) -> Tuple[int, ...]:
@@ -45,7 +45,7 @@ class TestFileOptions(TypedDict):
4545
class FunctionalTestFile:
4646
"""A single functional test case file with options."""
4747

48-
_CONVERTERS = {
48+
_CONVERTERS: Dict[str, Callable[[str], Union[Tuple[int, ...], List[str]]]] = {
4949
"min_pyver": parse_python_version,
5050
"max_pyver": parse_python_version,
5151
"min_pyver_end_position": parse_python_version,

pylint/testutils/get_test_info.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33

44
from glob import glob
55
from os.path import basename, join, splitext
6+
from typing import List, Tuple
67

78
from pylint.testutils.constants import SYS_VERS_STR
89

910

10-
def _get_tests_info(input_dir, msg_dir, prefix, suffix):
11+
def _get_tests_info(
12+
input_dir: str, msg_dir: str, prefix: str, suffix: str
13+
) -> List[Tuple[str, str]]:
1114
"""get python input examples and output messages
1215
1316
We use following conventions for input files and messages:

0 commit comments

Comments
 (0)