code: def record_testreport(self, testreport):
      assert not self.testcase
      names = mangle_test_address(testreport.nodeid)
      existing_attrs = self.attrs
      classnames = names[:-1]
      if self.xml.prefix:
          classnames.insert(0, self.xml.prefix)
      attrs = {
          "classname": ".".join(classnames),
          "name": bin_xml_escape(names[-1]),
          "file": testreport.location[0],
      }
      if testreport.location[1] is not None:
          attrs["line"] = testreport.location[1]
      if hasattr(testreport, "url"):
          attrs["url"] = testreport.url
      self.attrs = attrs
      self.attrs.update(
          existing_attrs
      )  # restore any user-defined attributes
  
      # Preserve legacy testcase behavior
      if self.family == "xunit1":
          return
  
      # Filter out attributes not permitted by this test family.
      # Including custom attributes because they are not valid here.
      temp_attrs = {}
      for key in self.attrs.keys():
          if key in families[self.family]["testcase"]:
              temp_attrs[key] = self.attrs[key]
      self.attrs = temp_attrs
  
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 _NodeReporter obj's underlying member method code with example usage: obj.record_testreport(testreport) without return types