class_docstr: base class for Collector and Item the test collection tree.
  Collector subclasses have children, Items are terminal nodes.
docstr: 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"))
docstr_tok: ["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","''",")",")"]
code: def warn(self, warning):
      """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"))
  
      """
      from _pytest.warning_types import PytestWarning
  
      if not isinstance(warning, PytestWarning):
          raise ValueError(
              "warning must be an instance of PytestWarning or subclass, got {!r}".format(
                  warning
              )
          )
      path, lineno = get_fslocation_from_item(self)
      warnings.warn_explicit(
          warning,
          category=None,
          filename=str(path),
          lineno=lineno + 1 if lineno is not None else None,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import warnings
  import py
  import six
  import _pytest._code
  from _pytest.compat import getfslineno
  from _pytest.mark.structures import NodeKeywords
  from _pytest.outcomes import fail
label_desc: Use image node_id 4 for calling the Node obj's underlying member method code with example usage: obj.warn(warning) without return types