Skip to content

Commit

Permalink
add docstring to warn_explicit_for
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Sep 20, 2022
1 parent e1d1c75 commit 807e287
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/_pytest/warning_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down

0 comments on commit 807e287

Please sign in to comment.