Commit e0bfe97a by taoke

excle中参数,header,期望不符合格式时统一为None

parent 9bd51cfc
...@@ -31,12 +31,15 @@ def get_excelData(workBook,sheetName,caseName): ...@@ -31,12 +31,15 @@ def get_excelData(workBook,sheetName,caseName):
dict0['testPoint']= workSheet.cell_value(idx, num_testPoint) dict0['testPoint']= workSheet.cell_value(idx, num_testPoint)
# json字符串转换成字典 # json字符串转换成字典
dict0['expectData'] = json.loads(dict0['expectData']) try:
dict0['expectData'] = json.loads(dict0['expectData'])
except:
dict0['expectData'] = None
if dict0['reqData'] == "": try:
dict0['reqData']= None
else:
dict0['reqData'] = json.loads(dict0['reqData']) dict0['reqData'] = json.loads(dict0['reqData'])
except:
dict0['reqData'] = None
try: try:
dict0['headers'] = json.loads(dict0['headers']) dict0['headers'] = json.loads(dict0['headers'])
......
...@@ -27,4 +27,6 @@ if __name__ == "__main__": ...@@ -27,4 +27,6 @@ if __name__ == "__main__":
# 生成报告数据 # 生成报告数据
pytest.main(['-v', '-s', test_case_dir, '--alluredir', './report/tmp']) pytest.main(['-v', '-s', test_case_dir, '--alluredir', './report/tmp'])
# 打开报告 # 打开报告
# os.system('allure serve ./report/tmp') os.system('allure serve ./report/tmp')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment