Skip to content

Commit dde2379

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent df9a1a2 commit dde2379

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

pylint_pytest/checkers/class_attr_loader.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Optional, Set
2-
31
from astroid import Assign, Attribute, ClassDef, Name
42

53
from ..utils import _can_use_fixture, _is_class_autouse_fixture
@@ -10,8 +8,8 @@ class ClassAttrLoader(BasePytestChecker):
108
msgs = {"E6400": ("", "pytest-class-attr-loader", "")}
119

1210
in_setup = False
13-
request_cls: Set[str] = set()
14-
class_node: Optional[ClassDef] = None
11+
request_cls: set[str] = set()
12+
class_node: ClassDef | None = None
1513

1614
def visit_functiondef(self, node):
1715
"""determine if a method is a class setup method"""

pylint_pytest/checkers/fixture.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import sys
44
from pathlib import Path
5-
from typing import Set, Tuple
65

76
import astroid
87
import pylint
@@ -20,7 +19,7 @@
2019
from .types import FixtureDict, replacement_add_message
2120

2221
# TODO: support pytest python_files configuration
23-
FILE_NAME_PATTERNS: Tuple[str, ...] = ("test_*.py", "*_test.py")
22+
FILE_NAME_PATTERNS: tuple[str, ...] = ("test_*.py", "*_test.py")
2423
ARGUMENT_ARE_KEYWORD_ONLY = (
2524
"https://docs.pytest.org/en/stable/deprecations.html#pytest-fixture-arguments-are-keyword-only"
2625
)
@@ -29,7 +28,7 @@
2928
class FixtureCollector:
3029
# Same as ``_pytest.fixtures.FixtureManager._arg2fixturedefs``.
3130
fixtures: FixtureDict = {}
32-
errors: Set[pytest.CollectReport] = set()
31+
errors: set[pytest.CollectReport] = set()
3332

3433
def pytest_sessionfinish(self, session):
3534
# pylint: disable=protected-access
@@ -77,9 +76,9 @@ class FixtureChecker(BasePytestChecker):
7776
# Store all fixtures discovered by pytest session
7877
_pytest_fixtures: FixtureDict = {}
7978
# Stores all used function arguments
80-
_invoked_with_func_args: Set[str] = set()
79+
_invoked_with_func_args: set[str] = set()
8180
# Stores all invoked fixtures through @pytest.mark.usefixture(...)
82-
_invoked_with_usefixtures: Set[str] = set()
81+
_invoked_with_usefixtures: set[str] = set()
8382
_original_add_message = replacement_add_message
8483

8584
def open(self):

pylint_pytest/checkers/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import sys
22
from pprint import pprint
3-
from typing import Any, Dict, List
3+
from typing import Any
44

55
from _pytest.fixtures import FixtureDef
66

7-
FixtureDict = Dict[str, List[FixtureDef[Any]]]
7+
FixtureDict = dict[str, list[FixtureDef[Any]]]
88

99

1010
def replacement_add_message(*args, **kwargs):

tests/base_tester.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
from abc import ABC
44
from pprint import pprint
5-
from typing import Any, Dict, List
5+
from typing import Any
66

77
import astroid
88
from pylint.testutils import MessageTest, UnittestLinter
@@ -23,10 +23,10 @@
2323

2424
class BasePytestTester(ABC):
2525
CHECKER_CLASS = BaseChecker
26-
IMPACTED_CHECKER_CLASSES: List[BaseChecker] = []
26+
IMPACTED_CHECKER_CLASSES: list[BaseChecker] = []
2727
MSG_ID: str
28-
msgs: List[MessageTest] = []
29-
CONFIG: Dict[str, Any] = {}
28+
msgs: list[MessageTest] = []
29+
CONFIG: dict[str, Any] = {}
3030

3131
def __init_subclass__(cls, **kwargs):
3232
super().__init_subclass__(**kwargs)

0 commit comments

Comments
 (0)