class_docstr: A test runner class that outputs the results in JUnit like XML files.
      
docstr: Run the given test case or test suite.
docstr_tok: ["Run","the","given","test","case","or","test","suite","."]
code: def run(self, test):
      "Run the given test case or test suite."
      # Prepare the test execution
      result = self._make_result()
  
      # Print a nice header
      self.stream.writeln()
      self.stream.writeln("Running tests...")
      self.stream.writeln(result.separator2)
  
      # Execute tests
      start_time = time.time()
      test(result)
      stop_time = time.time()
      time_taken = stop_time - start_time
  
      # Generate reports
      self.stream.writeln()
      self.stream.writeln("Generating XML reports...")
      result.generate_reports(self)
  
      # Print results
      result.printErrors()
      self.stream.writeln(result.separator2)
      run = result.testsRun
      self.stream.writeln(
          "Ran %d test%s in %.3fs"
          % (run, run != 1 and "s" or "", time_taken)
      )
      self.stream.writeln()
  
      # Error traces
      if not result.wasSuccessful():
          self.stream.write("FAILED (")
          failed, errored = (len(result.failures), len(result.errors))
          if failed:
              self.stream.write("failures=%d" % failed)
          if errored:
              if failed:
                  self.stream.write(", ")
              self.stream.write("errors=%d" % errored)
          self.stream.writeln(")")
      else:
          self.stream.writeln("OK")
  
      return result
  
imports: from __future__ import absolute_import
  import os
  import sys
  import time
  from unittest import TestResult, TextTestResult, TextTestRunner
  import xml.dom.minidom
label_desc: Use image node_id 3 for calling the XMLTestRunner obj's underlying member method code with example usage: obj.run(test) and returns: result