优化日志输出,增加时间分界线
This commit is contained in:
@@ -392,10 +392,9 @@ if __name__ == '__main__':
|
||||
lognewestpath = "/root/result_self_test/unittest/unittest_result.log.newest"
|
||||
with open(lognewestpath,"w+") as f:
|
||||
runner = unittest.TextTestRunner(stream=f,verbosity=2)
|
||||
f.write("Test start time: ")
|
||||
f.write(time.asctime(time.localtime(time.time())))
|
||||
f.write("\n")
|
||||
f.write("\n" + "#"*50 + "Test start time: " + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "#"*50 + "\n")
|
||||
runner.run(suite)
|
||||
f.write("\n" + "="*50 + "Test end time: " + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "="*50 + "\n")
|
||||
f.close()
|
||||
with open(logpath,"a+") as f:
|
||||
fn = open(lognewestpath,'r')
|
||||
|
||||
Reference in New Issue
Block a user