docstr: handle a setup/call/teardown report, generating the appropriate
  xml tags as necessary.
  
  note: due to plugins like xdist, this hook may be called in interlaced
  order with reports from other nodes. for example:
  
  usual call order:
      -> setup node1
      -> call node1
      -> teardown node1
      -> setup node2
      -> call node2
      -> teardown node2
  
  possible call order in xdist:
      -> setup node1
      -> call node1
      -> setup node2
      -> call node2
      -> teardown node2
      -> teardown node1
code: def pytest_runtest_logreport(self, report):
      """handle a setup/call/teardown report, generating the appropriate
      xml tags as necessary.
  
      note: due to plugins like xdist, this hook may be called in interlaced
      order with reports from other nodes. for example:
  
      usual call order:
          -> setup node1
          -> call node1
          -> teardown node1
          -> setup node2
          -> call node2
          -> teardown node2
  
      possible call order in xdist:
          -> setup node1
          -> call node1
          -> setup node2
          -> call node2
          -> teardown node2
          -> teardown node1
      """
      close_report = None
      if report.passed:
          if report.when == "call":  # ignore setup/teardown
              reporter = self._opentestcase(report)
              reporter.append_pass(report)
      elif report.failed:
          if report.when == "teardown":
              # The following vars are needed when xdist plugin is used
              report_wid = getattr(report, "worker_id", None)
              report_ii = getattr(report, "item_index", None)
              close_report = next(
                  (
                      rep
                      for rep in self.open_reports
                      if (
                          rep.nodeid == report.nodeid
                          and getattr(rep, "item_index", None)
                          == report_ii
                          and getattr(rep, "worker_id", None)
                          == report_wid
                      )
                  ),
                  None,
              )
              if close_report:
                  # We need to open new testcase in case we have failure in
                  # call and error in teardown in order to follow junit
                  # schema
                  self.finalize(close_report)
                  self.cnt_double_fail_tests += 1
          reporter = self._opentestcase(report)
          if report.when == "call":
              reporter.append_failure(report)
              self.open_reports.append(report)
              if not self.log_passing_tests:
                  reporter.write_captured_output(report)
          else:
              reporter.append_error(report)
      elif report.skipped:
          reporter = self._opentestcase(report)
          reporter.append_skipped(report)
      self.update_testcase_duration(report)
      if report.when == "teardown":
          reporter = self._opentestcase(report)
          reporter.write_captured_output(report)
  
          for propname, propvalue in report.user_properties:
              reporter.add_property(propname, propvalue)
  
          self.finalize(report)
          report_wid = getattr(report, "worker_id", None)
          report_ii = getattr(report, "item_index", None)
          close_report = next(
              (
                  rep
                  for rep in self.open_reports
                  if (
                      rep.nodeid == report.nodeid
                      and getattr(rep, "item_index", None) == report_ii
                      and getattr(rep, "worker_id", None) == report_wid
                  )
              ),
              None,
          )
          if close_report:
              self.open_reports.remove(close_report)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import os
  import platform
  import re
  import sys
  import time
  from datetime import datetime
  import py
  import six
  import pytest
  from _pytest import nodes
  from _pytest.config import filename_arg
label_desc: Use image node_id 6 for calling the LogXML obj's underlying member method code with example usage: obj.pytest_runtest_logreport(report) without return types