diff --git a/changelog/5180.removal.rst b/changelog/5180.removal.rst index dfe9c5f8d..c78bbc876 100644 --- a/changelog/5180.removal.rst +++ b/changelog/5180.removal.rst @@ -15,6 +15,8 @@ removed: * ``tmpdir_factory.ensuretemp`` method. +* ``pytest_logwarning`` hook. + For more information consult `Deprecations and Removals `__ in the docs. diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index fff7af2f9..3d3f73a60 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -41,9 +41,3 @@ RESULT_LOG = PytestDeprecationWarning( "--result-log is deprecated and scheduled for removal in pytest 6.0.\n" "See https://docs.pytest.org/en/latest/deprecations.html#result-log-result-log for more information." ) - - -PYTEST_LOGWARNING = PytestDeprecationWarning( - "pytest_logwarning is deprecated, no longer being called, and will be removed soon\n" - "please use pytest_warning_captured instead" -) diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 9e6d13fab..59fc569f4 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -1,7 +1,6 @@ """ hook specifications for pytest plugins, invoked from main.py and builtin plugins. """ from pluggy import HookspecMarker -from _pytest.deprecated import PYTEST_LOGWARNING hookspec = HookspecMarker("pytest") @@ -575,27 +574,6 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config): """ -@hookspec(historic=True, warn_on_impl=PYTEST_LOGWARNING) -def pytest_logwarning(message, code, nodeid, fslocation): - """ - .. deprecated:: 3.8 - - This hook is will stop working in a future release. - - pytest no longer triggers this hook, but the - terminal writer still implements it to display warnings issued by - :meth:`_pytest.config.Config.warn` and :meth:`_pytest.nodes.Node.warn`. Calling those functions will be - an error in future releases. - - process a warning specified by a message, a code string, - a nodeid and fslocation (both of which may be None - if the warning is not tied to a particular node/location). - - .. note:: - This hook is incompatible with ``hookwrapper=True``. - """ - - @hookspec(historic=True) def pytest_warning_captured(warning_message, when, item): """