Skip to content

Commit ada80d5

Browse files
authored
Merge pull request #14335 from bluetech/sched-rm-legacy-hook-marks
Schedule deprecated legacy hook marks for removal in pytest 10
2 parents 2a74cdf + bf9977f commit ada80d5

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

changelog/14335.deprecation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The method of configuring hooks using markers, deprecated since pytest 7.2, is now scheduled to be removed in pytest 10.
2+
See :ref:`hook-markers` for more details.

doc/en/deprecations.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,13 @@ Simply remove the ``__init__.py`` file entirely.
171171
Python 3.3+ natively supports namespace packages without ``__init__.py``.
172172

173173

174+
.. _hook-markers:
175+
174176
Configuring hook specs/impls using markers
175177
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176178

179+
.. deprecated:: 7.2
180+
177181
Before pluggy, pytest's plugin library, was its own package and had a clear API,
178182
pytest just used ``pytest.mark`` to configure hooks.
179183

src/_pytest/deprecated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040

4141
HOOK_LEGACY_MARKING = UnformattedWarning(
42-
PytestDeprecationWarning,
42+
PytestRemovedIn10Warning,
4343
"The hook{type} {fullname} uses old-style configuration options (marks or attributes).\n"
4444
"Please use the pytest.hook{type}({hook_opts}) decorator instead\n"
4545
" to configure the hooks.\n"

0 commit comments

Comments
 (0)