[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-04-13 00:00:18 +00:00
parent 72ad6dc953
commit f4cd1ba0d6
813 changed files with 66015 additions and 58839 deletions

View file

@ -1,10 +1,10 @@
from __future__ import annotations
import functools
import warnings
from pathlib import Path
from typing import Any
from typing import Mapping
import warnings
import pluggy
@ -15,19 +15,19 @@ from ..deprecated import HOOK_LEGACY_PATH_ARG
# hookname: (Path, LEGACY_PATH)
imply_paths_hooks: Mapping[str, tuple[str, str]] = {
"pytest_ignore_collect": ("collection_path", "path"),
"pytest_collect_file": ("file_path", "path"),
"pytest_pycollect_makemodule": ("module_path", "path"),
"pytest_report_header": ("start_path", "startdir"),
"pytest_report_collectionfinish": ("start_path", "startdir"),
'pytest_ignore_collect': ('collection_path', 'path'),
'pytest_collect_file': ('file_path', 'path'),
'pytest_pycollect_makemodule': ('module_path', 'path'),
'pytest_report_header': ('start_path', 'startdir'),
'pytest_report_collectionfinish': ('start_path', 'startdir'),
}
def _check_path(path: Path, fspath: LEGACY_PATH) -> None:
if Path(fspath) != path:
raise ValueError(
f"Path({fspath!r}) != {path!r}\n"
"if both path and fspath are given they need to be equal"
f'Path({fspath!r}) != {path!r}\n'
'if both path and fspath are given they need to be equal',
)
@ -61,7 +61,7 @@ class PathAwareHookProxy:
if fspath_value is not None:
warnings.warn(
HOOK_LEGACY_PATH_ARG.format(
pylib_path_arg=fspath_var, pathlib_path_arg=path_var
pylib_path_arg=fspath_var, pathlib_path_arg=path_var,
),
stacklevel=2,
)