class_docstr: Holder for test result information.
  
  Test results are automatically managed by the TestCase and TestSuite
  classes, and do not need to be explicitly manipulated by writers of tests.
  
  Each instance holds the total number of tests run, and collections of
  failures and errors that occurred among those test runs. The collections
  contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
  formatted traceback of the error that occurred.
class_docstr_tok: ["Holder","for","test","result","information",".","Test","results","are","automatically","managed","by","the","TestCase","and","TestSuite","classes",",","and","do","not","need","to","be","explicitly","manipulated","by","writers","of","tests",".","Each","instance","holds","the","total","number","of","tests","run",",","and","collections","of","failures","and","errors","that","occurred","among","those","test","runs",".","The","collections","contain","tuples","of","(","testcase",",","exceptioninfo",")",",","where","exceptioninfo","is","the","formatted","traceback","of","the","error","that","occurred","."]
docstr: Called when a test finished to run, regardless of its outcome.
  *test* is the test case corresponding to the test method.
  *elapsed* is the time represented in seconds, and it includes the
  execution of cleanup functions.
docstr_tok: ["Called","when","a","test","finished","to","run",",","regardless","of","its","outcome",".","*","test","*","is","the","test","case","corresponding","to","the","test","method",".","*","elapsed","*","is","the","time","represented","in","seconds",",","and","it","includes","the","execution","of","cleanup","functions","."]
code: def addDuration(self, test, elapsed):
      """Called when a test finished to run, regardless of its outcome.
      *test* is the test case corresponding to the test method.
      *elapsed* is the time represented in seconds, and it includes the
      execution of cleanup functions.
      """
      # support for a TextTestRunner using an old TestResult class
      if hasattr(self, "collectedDurations"):
          # Pass test repr and not the test object itself to avoid resources leak
          self.collectedDurations.append((str(test), elapsed))
  
imports: import io
  import sys
  import traceback
  from .None import util
  from functools import wraps
label_desc: Use image node_id 16 for calling the TestResult obj's underlying member method code with example usage: obj.addDuration(test, elapsed) without return types