def stopTestRun(self):
self.stopTime = time.time()<EOL>self.timeTaken = self.stopTime - self.startTime<EOL>self.printErrors()<EOL>if self.args.run_coverage or self.args.quiet_coverage:<EOL><INDENT>from coverage.misc import CoverageException<EOL>try:<EOL><INDENT>self.stream.writeln()<EOL>self.args.cov.stop()<EOL>self.args.cov.save()<EOL>self.args.cov.combine()<EOL>self.args.cov.save()<EOL>if not self.args.quiet_coverage:<EOL><INDENT>self.stream.coverage_percent = None<EOL>self.args.cov.report(file=self.stream,<EOL>omit=self.args.omit_patterns,<EOL>show_missing=True)<EOL>self.coverage_percent = self.stream.coverage_percent<EOL><DEDENT><DEDENT>except CoverageException as ce:<EOL><INDENT>if (len(ce.args) == <NUM_LIT:1>) and ("<STR_LIT>" not in ce.args[<NUM_LIT:0>]):<EOL><INDENT>raise ce<EOL><DEDENT><DEDENT><DEDENT>if self.testsRun and not self.shouldStop:<EOL><INDENT>self.stream.writeln()<EOL><DEDENT>if self.shouldStop:<EOL><INDENT>self.stream.writeln()<EOL>self.stream.writeln(self.colors.yellow(<EOL>"<STR_LIT>"))<EOL>self.stream.writeln()<EOL><DEDENT>self.stream.writeln("<STR_LIT>" %<EOL>(self.colors.bold(str(self.testsRun)),<EOL>self.testsRun != <NUM_LIT:1> and "<STR_LIT:s>" or "<STR_LIT>",<EOL>self.colors.bold("<STR_LIT>" % self.timeTaken),<EOL>self.colors.bold("<STR_LIT>" % self.args.processes),<EOL>self.args.processes != <NUM_LIT:1> and "<STR_LIT>" or "<STR_LIT>"))<EOL>self.stream.writeln()<EOL>results = [<EOL>(self.errors, '<STR_LIT>', self.colors.error),<EOL>(self.expectedFailures, '<STR_LIT>',<EOL>self.colors.expectedFailure),<EOL>(self.failures, '<STR_LIT>', self.colors.failing),<EOL>(self.passing, '<STR_LIT>', self.colors.passing),<EOL>(self.skipped, '<STR_LIT>', self.colors.skipped),<EOL>(self.unexpectedSuccesses, '<STR_LIT>',<EOL>self.colors.unexpectedSuccess),<EOL>]<EOL>stats = []<EOL>for obj_list, name, color_func in results:<EOL><INDENT>if obj_list:<EOL><INDENT>stats.append("<STR_LIT>".format(name,<EOL>color_func(str(len(obj_list)))))<EOL><DEDENT><DEDENT>if not stats:<EOL><INDENT>self.stream.writeln(self.colors.failing("<STR_LIT>"))<EOL><DEDENT>else:<EOL><INDENT>grade = self.colors.passing('<STR_LIT:OK>')<EOL>if self.errors or self.failures:<EOL><INDENT>grade = self.colors.failing('<STR_LIT>')<EOL><DEDENT>self.stream.writeln("<STR_LIT>".format(grade, '<STR_LIT:U+002CU+0020>'.join(stats)))<EOL><DEDENT>
Called once after all tests have run