Commit 224ffd159bc17ab872174c1ef065b7ece6b845f3

Authored by liujiqiang
1 parent 75bad4d8

删除print信息

commons/scripts/delReport.py
@@ -12,16 +12,16 @@ @@ -12,16 +12,16 @@
12 import os,sys 12 import os,sys
13 13
14 def delReport(path,delNum=5): 14 def delReport(path,delNum=5):
15 - print("path",path) 15 + # print("path",path)
16 if os.name == "nt": 16 if os.name == "nt":
17 report_route = os.path.abspath(os.path.join(path, "../")) 17 report_route = os.path.abspath(os.path.join(path, "../"))
18 else: 18 else:
19 report_route = os.path.abspath(os.path.join(path)) 19 report_route = os.path.abspath(os.path.join(path))
20 file_list = os.listdir(report_route + "/report/") 20 file_list = os.listdir(report_route + "/report/")
21 - print("delReport file_lis --- ", file_list) 21 + # print("delReport file_lis --- ", file_list)
22 if len(file_list) > delNum: 22 if len(file_list) > delNum:
23 file_list = file_list[:0-delNum] 23 file_list = file_list[:0-delNum]
24 - print("if file_lis --- ",file_list) 24 + # print("if file_lis --- ",file_list)
25 for i in file_list: 25 for i in file_list:
26 if os.path.isfile(report_route + "/report/" + i) and ".log" not in i: 26 if os.path.isfile(report_route + "/report/" + i) and ".log" not in i:
27 os.remove(report_route + "/report/" + i) 27 os.remove(report_route + "/report/" + i)
@@ -38,7 +38,6 @@ def Run_Testcase(testsuit): @@ -38,7 +38,6 @@ def Run_Testcase(testsuit):
38 '''运行测试用例并生成报告''' 38 '''运行测试用例并生成报告'''
39 now = time.strftime("%Y-%m-%d %H_%M_%S", time.localtime()) 39 now = time.strftime("%Y-%m-%d %H_%M_%S", time.localtime())
40 path = os.path.dirname(os.path.abspath(sys.argv[0])) 40 path = os.path.dirname(os.path.abspath(sys.argv[0]))
41 - print("path -1- ",path)  
42 report_file = os.path.abspath(os.path.join(path))+ "/report/" + now + "_result.html" 41 report_file = os.path.abspath(os.path.join(path))+ "/report/" + now + "_result.html"
43 # 创建报告文件 42 # 创建报告文件
44 fp = open(report_file, 'wb') 43 fp = open(report_file, 'wb')
@@ -51,7 +50,6 @@ def Run_Testcase(testsuit): @@ -51,7 +50,6 @@ def Run_Testcase(testsuit):
51 runner.run(testsuit) 50 runner.run(testsuit)
52 # 关闭文件 51 # 关闭文件
53 fp.close() 52 fp.close()
54 - print("path -1- ", path)  
55 delReport.delReport(path) 53 delReport.delReport(path)
56 return report_file 54 return report_file
57 55