标签:数据 for item png st3 返回值 inf info 接口
将接口测试的返回值,写入到表格中
# 将testresult的数据写入csv中
# w为覆盖写,a为追加写
import csv
testresult = {"接口名称":"登录接口","测试结果":"测试通过"}
file = open("test2.csv","w")
for key,value,in testresult.items():
print(key,value)
file.write(str(key)+","+str(value)+"\n")
file.close()
testresult = {"接口名称":"登录接口","测试结果":"测试通过"}
file = open("test3.csv","w")
for key,value,in testresult.items():
print(key,value)
file.write(str(key)+","+str(value)+",")
file.write("\n")
file.close()
标签:数据 for item png st3 返回值 inf info 接口
原文地址:https://www.cnblogs.com/lucky-sunshine/p/12215188.html