code: def pytest_sessionfinish(self):
      dirname = os.path.dirname(os.path.abspath(self.logfile))
      if not os.path.isdir(dirname):
          os.makedirs(dirname)
      logfile = open(self.logfile, "w", encoding="utf-8")
      suite_stop_time = time.time()
      suite_time_delta = suite_stop_time - self.suite_start_time
  
      numtests = (
          self.stats["passed"]
          + self.stats["failure"]
          + self.stats["skipped"]
          + self.stats["error"]
          - self.cnt_double_fail_tests
      )
      logfile.write('<?xml version="1.0" encoding="utf-8"?>')
  
      suite_node = Junit.testsuite(
          self._get_global_properties_node(),
          [x.to_xml() for x in self.node_reporters_ordered],
          name=self.suite_name,
          errors=self.stats["error"],
          failures=self.stats["failure"],
          skipped=self.stats["skipped"],
          tests=numtests,
          time="%.3f" % suite_time_delta,
          timestamp=datetime.fromtimestamp(
              self.suite_start_time
          ).isoformat(),
          hostname=platform.node(),
      )
      logfile.write(Junit.testsuites([suite_node]).unicode(indent=0))
      logfile.close()
  
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 11 for calling the LogXML obj's underlying member method code with example usage: obj.pytest_sessionfinish() without return types