diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-09-09 11:05:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 11:05:00 +0200 |
commit | c0272571bcdba466f237e0aeadff289e53f8bedd (patch) | |
tree | 7e2ee7394b4b29dbcb1f45da88d02958bea43c32 /tests/test_func.py | |
parent | f29bdd4e04c8c144b378220434646b37a8e7d9a0 (diff) | |
download | pylint-git-c0272571bcdba466f237e0aeadff289e53f8bedd.tar.gz |
Add typing to several test files (#7440)
Diffstat (limited to 'tests/test_func.py')
-rw-r--r-- | tests/test_func.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/test_func.py b/tests/test_func.py index b799cf12b..6fd7585b9 100644 --- a/tests/test_func.py +++ b/tests/test_func.py @@ -104,14 +104,16 @@ class LintTestUpdate(LintTestUsingModule): f.write(got) -def gen_tests(filter_rgx): +def gen_tests( + filter_rgx: str | re.Pattern[str] | None, +) -> list[tuple[str, str, list[tuple[str, str]]]]: if filter_rgx: is_to_run = re.compile(filter_rgx).search else: is_to_run = ( - lambda x: 1 # type: ignore[assignment] # pylint: disable=unnecessary-lambda-assignment + lambda x: 1 # type: ignore[assignment,misc] # pylint: disable=unnecessary-lambda-assignment ) # noqa: E731 We're going to throw all this anyway - tests = [] + tests: list[tuple[str, str, list[tuple[str, str]]]] = [] for module_file, messages_file in _get_tests_info(INPUT_DIR, MSG_DIR, "func_", ""): if not is_to_run(module_file) or module_file.endswith((".pyc", "$py.class")): continue @@ -135,7 +137,10 @@ TEST_WITH_EXPECTED_DEPRECATION = ["func_excess_escapes.py"] ids=[o[0] for o in gen_tests(FILTER_RGX)], ) def test_functionality( - module_file, messages_file, dependencies, recwarn: pytest.WarningsRecorder + module_file: str, + messages_file: str, + dependencies: list[tuple[str, str]], + recwarn: pytest.WarningsRecorder, ) -> None: __test_functionality(module_file, messages_file, dependencies) if recwarn.list: |