2
0
Fork 0

[tests] Flush logs before and after test run

This commit is contained in:
Stefan Bühler 2010-10-06 14:38:03 +02:00
parent db6a989677
commit 6516d55c1f
1 changed files with 9 additions and 0 deletions

View File

@ -401,6 +401,10 @@ allow-listen {{ ip "127.0.0.1:{Env.port}"; }}
testcount = len(self.run)
print >> Env.log, "[Start] Running tests"
Env.log.flush()
sys.stdout.flush()
sys.stderr.flush()
fmt = COLOR_BLUE + " {0:<%i} " % self.testname_len
failed = False
i = 1
@ -427,6 +431,11 @@ allow-listen {{ ip "127.0.0.1:{Env.port}"; }}
print >> sys.stdout, ("%i out of %i tests passed (%.2f%%), %i tests failed, %i todo items, %i todo items are ready" %
(self.stat_pass, testcount, (100.0 * self.stat_pass)/testcount, self.stat_fail, self.stat_todo, self.stat_done))
print >> Env.log, "[Done] Running tests [result=%s]" % (failed and "Failed" or "Succeeded")
Env.log.flush()
sys.stdout.flush()
sys.stderr.flush()
return not failed
def Cleanup(self):