#-*- coding: utf-8 -*-
# Filename: try_except.py
import sys
import csv
#generate the cases for certain release and status
def reporter_for_rel(rel,status,func):
num_func=0
for line in reader:
if line[8] == status and line[1]==rel and line[3]==func:
num_func+=1
writer.write(line[2]+',')
# if num_func!=0:
# writer.write('\nnum= '+'%d'%num_func)
# writer.write('\n')
return num_func
#get function area base on release number
def get_func(rel):
func=[]
for line in reader:
if line[1]==rel:
func.append(line[3])
func1=list(set(func))
return func1
#main function
if __name__ == "__main__":
global reader,writer,rel_func
rel_func=[]
writer =open("report.txt","w")
stas=['pass ','fail ',' ']
rel=['R20','R22','R23','R24','R25','R26','R27','R28']
rel_re={}
for rl0 in rel:
reader =csv.reader(file('planReport.csv','rb'))
rel_re[rl0]=get_func(rl0)
for sta in stas:
writer.write(sta+':\n')
writer.write('******************************\n')
for rl in rel:
#writer.write('\n'+rl+'('+sta+'):\n')
sum_rel=0
reporter=''
for fc in rel_re[rl]:
sum_func=0
#writer.write(fc+':\n')
reader =csv.reader(file('planReport.csv','rb'))
sum_func = reporter_for_rel(rl,sta,fc)
if sum_func==0:
writer.write('\n')
writer.write(fc+' '+'%d'%sum_func+' '+sta)
writer.write('\n')
sum_rel=sum_rel+sum_func
reporter=reporter+fc+' '
if sum_rel!=0:
writer.write('\n')
writer.write(rl+'('+'%d'%sum_rel+')'+sta+':'+reporter)
writer.write('\n******************************\n')
writer.close()
对 autoscape case 报告的统计
最新推荐文章于 2022-09-16 09:33:22 发布