From 83ca2ce465aa76d625250ba0a91db3a9b6a1de21 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 fd4b68e187c..88a51399182 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -148,6 +148,12 @@ def format(self, **kwargs: Any) -> _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__