add docstring to warn_explicit_for

This commit is contained in:
Ronny Pfannschmidt 2022-09-20 16:04:35 +02:00
parent 7e8a4849d8
commit ae9dbf5006
1 changed files with 6 additions and 0 deletions

View File

@ -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__