code: def printSummary(self, start, stop):
          
          def renderResultType(type, number, is_failure):
              """Return a rendering like '2 failures'.
  
              :arg type: A singular label, like "failure"
              :arg number: The number of tests with a result of that type
              :arg is_failure: Whether that type counts as a failure
  
              """
              # I'd rather hope for the best with plurals than totally punt on
              # being Englishlike:
              ret = '%s %s%s' % (number, type, 's' if number != 1 else '')
              if is_failure and number:
                  ret = self._term.bold(ret)
              return ret
  
          # Summarize the special cases:
          counts = [('test', self.testsRun, False),
                    ('failure', len(self.failures), True),
                    ('error', len(self.errors), True)]
          # Support custom errorclasses as well as normal failures and errors.
          # Lowercase any all-caps labels, but leave the rest alone in case there
          # are hard-to-read camelCaseWordBreaks.
          counts.extend([(label.lower() if label.isupper() else label,
                          len(storage),
                          is_failure)
                          for (storage, label, is_failure) in
                              self.errorClasses.values() if len(storage)])
          summary = (', '.join(renderResultType(*a) for a in counts) +
                     ' in %.1fs' % (stop - start))
  
          # Erase progress bar. Bash doesn't clear the whole line when printing
          # the prompt, leaving a piece of the bar. Also, the prompt may not be
          # at the bottom of the terminal.
          self.bar.erase()
          self.stream.writeln()
          if self.wasSuccessful():
              self.stream.write(self._term.bold_green('OK!  '))
          self.stream.writeln(summary)
docs: As a final summary, print number of tests, broken down by result.