nose-devs/nose — Issue #94: Test Time in TextTestResult
Author: jpellerin
Created: 2011-12-14 15:59:04+00:00
State: open

I wrote a plugin to format the tests results. Most of the information I
wanted was easy to get, with the exception of the total test time. It
would be nice to be able to access that value in a similar fashion as total
tests (TextTestResult.testsRun).

If TextTestResults stored the calculated total test time from PrintSummary
(or otherwise), it would be nice to have when generating the final report,
in finalize(), for example.

I ended up having to monkeypatch TextTestResults to get the total test time:

def prepareTestResult(self, result):
#Monkey Patch for TextTestResult to save the test time
old_print_summary = TextTestResult.printSummary

def new_print_summary(self, start, stop):
self.testTime = float(stop-start)
old_print_summary(self, start, stop)

TextTestResult.printSummary = new_print_summary

Thanks,

Mike

Google Code Info:
Issue #: 291
Author: mviam...@gmail.com
Created On: 2009-09-13T23:55:56.000Z
Closed On: