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