[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

@ -8,6 +8,7 @@ All constants defined in this module should be either instances of
:class:`PytestWarning`, or :class:`UnformattedWarning`
in case of warnings which need to format their messages.
"""
from __future__ import annotations
from warnings import warn
@ -19,50 +20,50 @@ from _pytest.warning_types import UnformattedWarning
# set of plugins which have been integrated into the core; we use this list to ignore
# them during registration to avoid conflicts
DEPRECATED_EXTERNAL_PLUGINS = {
"pytest_catchlog",
"pytest_capturelog",
"pytest_faulthandler",
'pytest_catchlog',
'pytest_capturelog',
'pytest_faulthandler',
}
# This can be* removed pytest 8, but it's harmless and common, so no rush to remove.
# * If you're in the future: "could have been".
YIELD_FIXTURE = PytestDeprecationWarning(
"@pytest.yield_fixture is deprecated.\n"
"Use @pytest.fixture instead; they are the same."
'@pytest.yield_fixture is deprecated.\n'
'Use @pytest.fixture instead; they are the same.',
)
# This deprecation is never really meant to be removed.
PRIVATE = PytestDeprecationWarning("A private pytest class or function was used.")
PRIVATE = PytestDeprecationWarning('A private pytest class or function was used.')
HOOK_LEGACY_PATH_ARG = UnformattedWarning(
PytestRemovedIn9Warning,
"The ({pylib_path_arg}: py.path.local) argument is deprecated, please use ({pathlib_path_arg}: pathlib.Path)\n"
"see https://docs.pytest.org/en/latest/deprecations.html"
"#py-path-local-arguments-for-hooks-replaced-with-pathlib-path",
'The ({pylib_path_arg}: py.path.local) argument is deprecated, please use ({pathlib_path_arg}: pathlib.Path)\n'
'see https://docs.pytest.org/en/latest/deprecations.html'
'#py-path-local-arguments-for-hooks-replaced-with-pathlib-path',
)
NODE_CTOR_FSPATH_ARG = UnformattedWarning(
PytestRemovedIn9Warning,
"The (fspath: py.path.local) argument to {node_type_name} is deprecated. "
"Please use the (path: pathlib.Path) argument instead.\n"
"See https://docs.pytest.org/en/latest/deprecations.html"
"#fspath-argument-for-node-constructors-replaced-with-pathlib-path",
'The (fspath: py.path.local) argument to {node_type_name} is deprecated. '
'Please use the (path: pathlib.Path) argument instead.\n'
'See https://docs.pytest.org/en/latest/deprecations.html'
'#fspath-argument-for-node-constructors-replaced-with-pathlib-path',
)
HOOK_LEGACY_MARKING = UnformattedWarning(
PytestDeprecationWarning,
"The hook{type} {fullname} uses old-style configuration options (marks or attributes).\n"
"Please use the pytest.hook{type}({hook_opts}) decorator instead\n"
" to configure the hooks.\n"
" See https://docs.pytest.org/en/latest/deprecations.html"
"#configuring-hook-specs-impls-using-markers",
'The hook{type} {fullname} uses old-style configuration options (marks or attributes).\n'
'Please use the pytest.hook{type}({hook_opts}) decorator instead\n'
' to configure the hooks.\n'
' See https://docs.pytest.org/en/latest/deprecations.html'
'#configuring-hook-specs-impls-using-markers',
)
MARKED_FIXTURE = PytestRemovedIn9Warning(
"Marks applied to fixtures have no effect\n"
"See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function"
'Marks applied to fixtures have no effect\n'
'See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function',
)
# You want to make some `__init__` or function "private".