class_docstr: A context manager to record raised warnings.
  
  Adapted from `warnings.catch_warnings`.
class_docstr_tok: ["A","context","manager","to","record","raised","warnings",".","Adapted","from","`","warnings.catch_warnings","`","."]
code: def __exit__(self, *exc_info):
      if not self._entered:
          __tracebackhide__ = True
          raise RuntimeError(
              "Cannot exit %r without entering first" % self
          )
      # see above where `self._saved_warn` is assigned
      if six.PY2:
          warnings.warn = self._saved_warn
      super(WarningsRecorder, self).__exit__(*exc_info)
  
      # Built-in catch_warnings does not reset entered state so we do it
      # manually here for this context manager to become reusable.
      self._entered = False
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import inspect
  import re
  import sys
  import warnings
  import six
  import _pytest._code
  from _pytest.deprecated import PYTEST_WARNS_UNKNOWN_KWARGS
  from _pytest.deprecated import WARNS_EXEC
  from _pytest.fixtures import yield_fixture
  from _pytest.outcomes import fail
label_desc: Use image node_id 9 for calling the WarningsRecorder obj's underlying member method code with example usage: obj.__exit__() without return types