def warn(self, warning):
from _pytest.warning_types import PytestWarning<EOL>if not isinstance(warning, PytestWarning):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>warning<EOL>)<EOL>)<EOL><DEDENT>path, lineno = get_fslocation_from_item(self)<EOL>warnings.warn_explicit(<EOL>warning,<EOL>category=None,<EOL>filename=str(path),<EOL>lineno=lineno + <NUM_LIT:1> if lineno is not None else None,<EOL>)<EOL>
Issue a warning for this item.

        Warnings will be displayed after the test session, unless explicitly suppressed

        :param Warning warning: the warning instance to issue. Must be a subclass of PytestWarning.

        :raise ValueError: if ``warning`` instance is not a subclass of PytestWarning.

        Example usage:

        .. code-block:: python

            node.warn(PytestWarning("some message"))