From ae9dbf5006286018440c0dead9b140f42c427286 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Sep 2022 16:04:35 +0200 Subject: [PATCH] add docstring to warn_explicit_for --- src/_pytest/warning_types.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index fd4b68e18..88a513991 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -148,6 +148,12 @@ class UnformattedWarning(Generic[_W]): def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: + """ + Issue the warning :param:`message` for the definition of the given :param:`method` + + this helps to log warnigns for functions defined prior to finding an issue with them + (like hook wrappers being marked in a legacy mechanism) + """ lineno = method.__code__.co_firstlineno filename = inspect.getfile(method) module = method.__module__