class_docstr: Basic test report object (also used for setup and teardown calls if
  they fail).
class_docstr_tok: ["Basic","test","report","object","(","also","used","for","setup","and","teardown","calls","if","they","fail",")","."]
docstr: Factory method to create and fill a TestReport with standard item and call info.
docstr_tok: ["Factory","method","to","create","and","fill","a","TestReport","with","standard","item","and","call","info","."]
code: def from_item_and_call(cls, item, call):
      """
      Factory method to create and fill a TestReport with standard item and call info.
      """
      when = call.when
      duration = call.stop - call.start
      keywords = {x: 1 for x in item.keywords}
      excinfo = call.excinfo
      sections = []
      if not call.excinfo:
          outcome = "passed"
          longrepr = None
      else:
          if not isinstance(excinfo, ExceptionInfo):
              outcome = "failed"
              longrepr = excinfo
          elif excinfo.errisinstance(skip.Exception):
              outcome = "skipped"
              r = excinfo._getreprcrash()
              longrepr = (str(r.path), r.lineno, r.message)
          else:
              outcome = "failed"
              if call.when == "call":
                  longrepr = item.repr_failure(excinfo)
              else:  # exception in setup or teardown
                  longrepr = item._repr_failure_py(
                      excinfo,
                      style=item.config.getoption("tbstyle", "auto"),
                  )
      for rwhen, key, content in item._report_sections:
          sections.append(("Captured %s %s" % (key, rwhen), content))
      return cls(
          item.nodeid,
          item.location,
          keywords,
          outcome,
          longrepr,
          when,
          sections,
          duration,
          user_properties=item.user_properties,
      )
  
imports: from pprint import pprint
  import py
  import six
  from _pytest._code.code import ExceptionInfo
  from _pytest._code.code import ReprEntry
  from _pytest._code.code import ReprEntryNative
  from _pytest._code.code import ReprExceptionInfo
  from _pytest._code.code import ReprFileLocation
  from _pytest._code.code import ReprFuncArgs
  from _pytest._code.code import ReprLocals
  from _pytest._code.code import ReprTraceback
  from _pytest._code.code import TerminalRepr
  from _pytest.outcomes import skip
  from _pytest.pathlib import Path
label_desc: Use image node_id 3 for calling the TestReport obj's underlying member method code with example usage: obj.from_item_and_call(cls, item, call) and returns: cls