class_docstr: A test result class that can express test results in a XML report.
  
  Used by XMLTestRunner.
docstr: Append a _TestInfo to the given target list and sets a callback
  method to be called by stopTest method.
docstr_tok: ["Append","a","_TestInfo","to","the","given","target","list","and","sets","a","callback","method","to","be","called","by","stopTest","method","."]
code: def _prepare_callback(
      self, test_info, target_list, verbose_str, short_str
  ):
      """Append a _TestInfo to the given target list and sets a callback
      method to be called by stopTest method.
      """
      target_list.append(test_info)
  
      def callback():
          """This callback prints the test method outcome to the stream,
          as well as the elapsed time.
          """
  
          # Ignore the elapsed times for a more reliable unit testing
          if not self.elapsed_times:
              self.start_time = self.stop_time = 0
  
          if self.showAll:
              self.stream.writeln(
                  "(%.3fs) %s"
                  % (test_info.get_elapsed_time(), verbose_str)
              )
          elif self.dots:
              self.stream.write(short_str)
  
      self.callback = callback
  
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 2 for calling the _XMLTestResult obj's underlying member method code with example usage: obj._prepare_callback(test_info, target_list, verbose_str, short_str) without return types