summaryrefslogtreecommitdiff
path: root/tests/test_func.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_func.py')
-rw-r--r--tests/test_func.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/test_func.py b/tests/test_func.py
index 207c9b8c9..17ff23ff5 100644
--- a/tests/test_func.py
+++ b/tests/test_func.py
@@ -4,10 +4,11 @@
"""Functional/non regression tests for pylint."""
+from __future__ import annotations
+
import re
import sys
from os.path import abspath, dirname, join
-from typing import List, Optional, Tuple
import pytest
@@ -29,13 +30,13 @@ def exception_str(self, ex) -> str: # pylint: disable=unused-argument
class LintTestUsingModule:
- INPUT_DIR: Optional[str] = None
+ INPUT_DIR: str | None = None
DEFAULT_PACKAGE = "input"
package = DEFAULT_PACKAGE
linter = linter
- module: Optional[str] = None
- depends: Optional[List[Tuple[str, str]]] = None
- output: Optional[str] = None
+ module: str | None = None
+ depends: list[tuple[str, str]] | None = None
+ output: str | None = None
def _test_functionality(self) -> None:
if self.module:
@@ -54,7 +55,7 @@ class LintTestUsingModule:
)
assert self._get_expected() == got, error_msg
- def _test(self, tocheck: List[str]) -> None:
+ def _test(self, tocheck: list[str]) -> None:
if self.module and INFO_TEST_RGX.match(self.module):
self.linter.enable("I")
else:
@@ -137,7 +138,7 @@ def test_functionality(
def __test_functionality(
- module_file: str, messages_file: str, dependencies: List[Tuple[str, str]]
+ module_file: str, messages_file: str, dependencies: list[tuple[str, str]]
) -> None:
lint_test = LintTestUpdate() if UPDATE_FILE.exists() else LintTestUsingModule()
lint_test.module = module_file.replace(".py", "")