This commit is contained in:
Kovid Goyal 2013-08-25 14:16:35 +05:30
parent 50ce1c08af
commit 1ea50f3d40

View File

@ -55,6 +55,7 @@ class TestResult(unittest.TextTestResult):
if self.wasSuccessful(): if self.wasSuccessful():
tests = sorted(self.times, key=self.times.get, reverse=True) tests = sorted(self.times, key=self.times.get, reverse=True)
slowest = ['%s [%g s]' % (t.id(), self.times[t]) for t in tests[:3]] slowest = ['%s [%g s]' % (t.id(), self.times[t]) for t in tests[:3]]
if len(slowest) > 1:
self.stream.writeln('\nSlowest tests: %s' % ' '.join(slowest)) self.stream.writeln('\nSlowest tests: %s' % ' '.join(slowest))
def find_tests(): def find_tests():