|
1 | | -from __future__ import annotations |
2 | | - |
3 | 1 | import fnmatch |
4 | 2 | import os |
5 | 3 | import sys |
6 | 4 | from pathlib import Path |
| 5 | +from typing import Set, Tuple |
7 | 6 |
|
8 | 7 | import astroid |
9 | 8 | import pylint |
|
22 | 21 | from .types import FixtureDict, replacement_add_message |
23 | 22 |
|
24 | 23 | # TODO: support pytest python_files configuration |
25 | | -FILE_NAME_PATTERNS: tuple[str, ...] = ("test_*.py", "*_test.py") |
| 24 | +FILE_NAME_PATTERNS: Tuple[str, ...] = ("test_*.py", "*_test.py") |
26 | 25 | ARGUMENT_ARE_KEYWORD_ONLY = ( |
27 | 26 | "https://docs.pytest.org/en/stable/deprecations.html#pytest-fixture-arguments-are-keyword-only" |
28 | 27 | ) |
|
31 | 30 | class FixtureCollector: |
32 | 31 | # Same as ``_pytest.fixtures.FixtureManager._arg2fixturedefs``. |
33 | 32 | fixtures: FixtureDict = {} |
34 | | - errors: set[pytest.CollectReport] = set() |
| 33 | + errors: Set[pytest.CollectReport] = set() |
35 | 34 |
|
36 | 35 | def pytest_sessionfinish(self, session): |
37 | 36 | # pylint: disable=protected-access |
@@ -80,9 +79,9 @@ class FixtureChecker(BasePytestChecker): |
80 | 79 | # Store all fixtures discovered by pytest session |
81 | 80 | _pytest_fixtures: FixtureDict = {} |
82 | 81 | # Stores all used function arguments |
83 | | - _invoked_with_func_args: set[str] = set() |
| 82 | + _invoked_with_func_args: Set[str] = set() |
84 | 83 | # Stores all invoked fixtures through @pytest.mark.usefixture(...) |
85 | | - _invoked_with_usefixtures: set[str] = set() |
| 84 | + _invoked_with_usefixtures: Set[str] = set() |
86 | 85 | _original_add_message = replacement_add_message |
87 | 86 |
|
88 | 87 | def open(self): |
|
0 commit comments