Commit 9ac8d080 by ALuo

接口自动化框架V3

parent 5b897b7f
......@@ -14,7 +14,7 @@ def log_config():
"""配置日志"""
logger = logging.getLogger("ALuo")
logger.level = logging.NOTSET
log_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "report/log/日志汇总.log")
log_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "report/log/log_summary.log")
handler = logging.FileHandler(log_path, mode="a", encoding="utf-8")
format = logging.Formatter('%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s - %(name)s')
handler.setFormatter(format)
......
......@@ -6,6 +6,8 @@
# Datetime: 2023/11/5 23:51
# Description: 对excel表进行操作
# ---------------------------------------------------------------------------
import os
import openpyxl
from interfaceAutoTest.common import alog
......@@ -16,18 +18,60 @@ from interfaceAutoTest.data_config.setting import *
class ReadExcel:
def __init__(self, table_name=None):
def __init__(self, author, table_name):
"""可根据需求填入工作表名,默认为配置文件中表名"""
# 获取ReadIni对象
self.read_ini = ReadIni()
# 获取配置文件的目录
self.config_dir = self.read_ini.config_dir
# 获取配置目录中除了ini文件外的所有路径
# 多用户操作
# 获取用户数据配置文件目录
self.author_dir = os.path.join(self.config_dir, author)
if not os.path.isdir(self.author_dir):
alog.error("请确保数据配置data_config目录下存在该用户的文件夹:" + author)
raise KeyError("请确保数据配置data_config目录下存在该用户的文件夹,详情请查看日志")
# 获取用户配置文件下的文件
filelist = os.listdir(self.author_dir)
excel_name = [file for file in filelist if file.endswith(".xlsx")]
if len(excel_name) != 1:
alog.error("请确保该用户的文件夹:" + author + " 存在或仅存在一个以'.xlsx'结尾的用例管理表:" + str(excel_name))
raise FileExistsError("请确保该用户文件下存在或仅存在一个用例管理的excel表")
self.excel_path = os.path.join(self.author_dir, excel_name[0])
case_data_path = os.path.join(self.author_dir, Case_Data + ".json")
expect_data_path = os.path.join(self.author_dir, Expect_Data + ".json")
sql_data_path = os.path.join(self.author_dir, Sql_Data + ".json")
# 读取excel表
self.wb = openpyxl.load_workbook(self.excel_path)
try:
self.ws = self.wb[table_name]
except:
alog.error("请确保该excel表中" + excel_name[0] + " 存在工作表:" + table_name)
raise KeyError("请确保表中存在该excel工作表,详情请查看日志")
# 获取json数据
self.case_data_dict = read_json.read_json(case_data_path)
self.expect_data_dict = read_json.read_json(expect_data_path)
if os.path.isfile(sql_data_path):
self.sql_data_dict = read_json.read_json(sql_data_path)
'''
# 单用户操作
self.excel_path = self.read_ini.get_file_path(Case_Excel)
case_data_path = self.read_ini.get_file_path(Case_Data)
expect_data_path = self.read_ini.get_file_path(Expect_Data)
sql_datta_path = self.read_ini.get_file_path(Sql_Data)
sql_data_path = self.read_ini.get_file_path(Sql_Data)
# 读取excel表
if table_name is None:
table_name = self.read_ini.get_table_name(Table_Name)
......@@ -38,11 +82,12 @@ class ReadExcel:
except:
alog.error("获取工作表错误,请检查:"+table_name)
raise KeyError("获取工作表错误,请检查,详情请查看日志")
'''
# 获取json数据
self.case_data_dict = read_json.read_json(case_data_path)
self.expect_data_dict = read_json.read_json(expect_data_path)
self.sql_data_dict = read_json.read_json(sql_datta_path)
# # 获取json数据
# self.case_data_dict = read_json.read_json(case_data_path)
# self.expect_data_dict = read_json.read_json(expect_data_path)
# self.sql_data_dict = read_json.read_json(sql_data_path)
def __get_cell_value(self, column: str, row: int):
"""根据传入的列号和行号获取某个单元格数据,并做预处理"""
......@@ -178,8 +223,8 @@ class ReadExcel:
if __name__ == '__main__':
read_excel = ReadExcel("BPM_add")
read_excel = ReadExcel("alin", "BPM-alin")
print(read_excel.get_case_data(3))
print(read_excel.get_expect_data(3))
print(read_excel.get_expect_data(13))
......@@ -22,9 +22,9 @@
"添加维度": {
"AddDemSuccess": {"code": "pkm", "name": "pokemon", "isDefault": 1, "description": "测试57期的维度-测试专用"},
"AddDemErrorCodeIsLong": {"code": "pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes","name": "pokemon","isDefault": 0,"description": "测试57期的维度-测试专用"},
"AddDemErrorCodeIsShort": {"code": "t","name": "pokemon","isDefault": 0,"description": "测试57期的维度-测试专用"},
"AddDemErrorCodeIsShort": {"code": "p","name": "pokemon","isDefault": 0,"description": "测试57期的维度-测试专用"},
"AddDemErrorCodeIsRepeat": {"code": "pkm","name": "pokemon","isDefault": 0,"description": "测试57期的维度-测试专用"},
"AddDemErrorCodeIsSpecial": {"code": "♥♠♤♂♀★☆※","name": "pokemon","isDefault": 0,"description": "测试57期的维度-测试专用"},
"AddDemErrorCodeIsSpecial": {"code": "p♥♠♤♂♀★☆※","name": "pokemon","isDefault": 0,"description": "测试57期的维度-测试专用"},
"AddDemErrorCodeIsNone":{"code": "","name":"pokemon","isDefault": 0,"description": "测试57期的维度-测试专用"},
"AddDemErrorNameIsLong": {"code": "pkm1","name":"pokemonpokemonpokemonpokemonpokemon","isDefault": 0,"description": "测试57期的维度"},
"AddDemErrorNameIsShort": {"code": "pkm2","name":"po","isDefault": 0,"description": "测试57期的维度"},
......
{
"维度管理": {
"添加维度": {
"AddDemSuccess": {"state": true, "message": "添加维度成功!"},
"AddDemErrorCodeIsLong": {"state": false, "message": "添加维度失败"},
"AddDemErrorCodeIsShort": {"state": false, "message": "添加维度失败"},
"AddDemErrorCodeIsRepeat": {"state": false, "message": "添加维度失败"},
"AddDemErrorCodeIsSpecial": {"state": false, "message": "添加维度失败"},
"AddDemErrorCodeIsNone": {"state": false, "message": "添加维度失败"},
"AddDemErrorNameIsLong": {"state": false, "message": "添加维度失败"},
"AddDemErrorNameIsShort": {"state": false, "message": "添加维度失败"},
"AddDemErrorNameIsNone": {"state": false, "message": "添加维度信息失败,维度名称【name】必填!"},
"AddDemErrorNameIsSpecial": {"state": false, "message": "添加维度失败"},
"AddDemErrorDefaultIs-1": {"state": false, "message": "添加维度失败"},
"AddDemErrorDefaultIs2": {"state": false, "message": "添加维度失败"},
"AddDemErrorDefaultNotIsInt": {"state": false, "message": " Cannot deserialize value of type `java.lang.Integer` from String \"isDefault\": not a valid Integer value at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])"},
"AddDemErrorDefaultIsSpecial": {"state": false, "message": " Cannot deserialize value of type `java.lang.Integer` from String \"\": not a valid Integer value at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])"},
"AddDemErrorMsgIsLong": {"state": false, "message": "添加维度失败"}
}
}
}
{
"认证接口":{
"登录系统":{
"LoginSuccess": {"password": "MTIzNDU2","username": "admin"},
"LoginPasswordDataError":{"password": "MTIzNDU212q","username": "admin"},
"LoginPasswordDataIsLong":{"password": "MTIzNDU2MTIzNDU2MTIzNDU2MTIzNDU2MTIzNDU2","username": "admin"},
"LoginPasswordDataIsShort":{"password": "M","username": "admin"},
"LoginPasswordDataIsNone":{"password": "","username": "admin"},
"LoginPasswordDataIsSpecial":{"password": "@@!@@!","username": "admin"},
"LoginUsernameDataError":{"password": "MTIzNDU2","username": "admin1"},
"LoginUsernameDataIsLong":{"password": "MTIzNDU2","username": "adminadminadminadmin"},
"LoginUsernameDataIsShort":{"password": "MTIzNDU2","username": "a"},
"LoginUsernameDataIsNone":{"password": "MTIzNDU2","username": ""},
"LoginUsernameDataIsSpecial": {"password": "MTIzNDU2","username": "@@!@@!"},
"LoginUsernameError": {"password": "MTIzNDU2","user": "admin"},
"LoginUsernameIsNone": {"password": "MTIzNDU2","": "admin"},
"LoginPasswordError": {"pass": "MTIzNDU2","username": "admin"},
"LoginPasswordIsNone": {"": "MTIzNDU2","username": "admin"}
}
}
}
......@@ -17,25 +17,6 @@
"LoginPasswordError": {"state": false, "message":"账号或密码错误"},
"LoginPasswordIsNone": {"state": false, "message":"账号或密码错误"}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {"state": true, "message": "添加维度成功!"},
"AddDemErrorCodeIsLong": {"state": false, "message": "添加维度失败"},
"AddDemErrorCodeIsShort": {"state": false, "message": "添加维度失败"},
"AddDemErrorCodeIsRepeat": {"state": false, "message": "添加维度失败"},
"AddDemErrorCodeIsSpecial": {"state": false, "message": "添加维度失败"},
"AddDemErrorCodeIsNone": {"state": false, "message": "添加维度失败"},
"AddDemErrorNameIsLong": {"state": false, "message": "添加维度失败"},
"AddDemErrorNameIsShort": {"state": false, "message": "添加维度失败"},
"AddDemErrorNameIsNone": {"state": false, "message": "添加维度失败"},
"AddDemErrorNameIsSpecial": {"state": false, "message": "添加维度失败"},
"AddDemErrorDefaultIs-1": {"state": false, "message": "添加维度失败"},
"AddDemErrorDefaultIs2": {"state": false, "message": "添加维度失败"},
"AddDemErrorDefaultNotIsInt": {"state": false, "message": "添加维度失败"},
"AddDemErrorDefaultIsSpecial": {"state": false, "message": "添加维度失败"},
"AddDemErrorMsgIsLong": {"state": false, "message": "添加维度失败"}
}
}
}
......
2023-11-08 18:21:32,347 - test_bpm.py[line:49] - ERROR: 反向-code过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes】在系统中已存在!","value":""} 用例数据:{'code': 'pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:32,837 - test_bpm.py[line:49] - ERROR: 反向-code过短 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【t】在系统中已存在!","value":""} 用例数据:{'code': 't', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:33,009 - test_bpm.py[line:49] - ERROR: 反向-code重复 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm】在系统中已存在!","value":""} 用例数据:{'code': 'pkm', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:33,202 - test_bpm.py[line:49] - ERROR: 反向-code为特殊字符 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【♥♠♤♂♀★☆※】在系统中已存在!","value":""} 用例数据:{'code': '♥♠♤♂♀★☆※', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:33,379 - test_bpm.py[line:49] - ERROR: 反向-name过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm1】在系统中已存在!","value":""} 用例数据:{'code': 'pkm1', 'name': 'pokemonpokemonpokemonpokemonpokemon', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:33,551 - test_bpm.py[line:49] - ERROR: 反向-name过短 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm2】在系统中已存在!","value":""} 用例数据:{'code': 'pkm2', 'name': 'po', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:33,727 - test_bpm.py[line:49] - ERROR: 反向-name为空 断言失败,因为 {"state":false,"message":"添加维度信息失败,维度名称【name】必填!","logId":"1722197660628172800"} 用例数据:{'code': 'pkm3', 'name': '', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:33,941 - test_bpm.py[line:49] - ERROR: 反向-name为特殊字符 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm4】在系统中已存在!","value":""} 用例数据:{'code': 'pkm4', 'name': '♥♠♤♂♀★☆※', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:34,112 - test_bpm.py[line:49] - ERROR: 反向-isDefault为-1 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm5】在系统中已存在!","value":""} 用例数据:{'code': 'pkm5', 'name': 'pokemon', 'isDefault': -1, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:34,283 - test_bpm.py[line:49] - ERROR: 反向-isDefault为2 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm6】在系统中已存在!","value":""} 用例数据:{'code': 'pkm6', 'name': 'pokemon', 'isDefault': 2, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:34,453 - test_bpm.py[line:49] - ERROR: 反向-isDefault不为整形 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"isDefault\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1722197663669043200"} 用例数据:{'code': 'pkm7', 'name': 'pokemon', 'isDefault': 'isDefault', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:34,672 - test_bpm.py[line:49] - ERROR: 反向-isDefault为特殊字符 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"※\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1722197664583401472"} 用例数据:{'code': 'pkm8', 'name': 'pokemon', 'isDefault': '※', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:21:34,882 - test_bpm.py[line:49] - ERROR: 反向-msg过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm9】在系统中已存在!","value":""} 用例数据:{'code': 'pkm9', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 18:41:38,824 - read_excel.py[line:33] - ERROR: 请确保数据配置data_config目录下存在该用户的文件夹:aluo1 - ALuo
2023-11-08 19:18:28,161 - read_excel.py[line:41] - ERROR: 请确保该用户的文件夹:aluo 存在以'.xlsx'结尾的用例管理表 - ALuo
2023-11-08 19:18:49,072 - read_excel.py[line:41] - ERROR: 请确保该用户的文件夹:aluo 存在以'.xlsx'结尾的用例管理表 - ALuo
2023-11-08 19:19:56,696 - read_excel.py[line:41] - ERROR: 请确保该用户的文件夹:aluo 存在或仅存在一个以'.xlsx'结尾的用例管理表:[] - ALuo
2023-11-08 19:20:34,035 - read_excel.py[line:41] - ERROR: 请确保该用户的文件夹:aluo 存在或仅存在一个以'.xlsx'结尾的用例管理表:['APIAutoTest_aluo.xlsx', 'APIAutoTest_aluo1.xlsx'] - ALuo
2023-11-08 19:25:38,188 - read_json.py[line:26] - ERROR: json文件路径错误未找到该json文件D:\PycharmProjects\interfaceAutoTest_v4\interfaceAutoTest\data_config\aluo\case_data - ALuo
2023-11-08 19:27:38,539 - read_ini.py[line:51] - ERROR: 请检查是否存在该文件:D:\PycharmProjects\interfaceAutoTest_v4\interfaceAutoTest\data_config\case_data.json - ALuo
2023-11-08 19:28:04,844 - read_ini.py[line:51] - ERROR: 请检查是否存在该文件:D:\PycharmProjects\interfaceAutoTest_v4\interfaceAutoTest\data_config\case_data.json - ALuo
2023-11-08 19:41:50,813 - read_excel.py[line:55] - ERROR: 请确保该excel表中APIAutoTest_aluo.xlsx 存在工作表:ok - ALuo
2023-11-08 19:43:42,541 - read_json.py[line:26] - ERROR: json文件路径错误未找到该json文件D:\PycharmProjects\interfaceAutoTest_v4\interfaceAutoTest\data_config\aluo\sql_data.json - ALuo
2023-11-08 20:01:47,941 - test_bpm.py[line:50] - ERROR: 反向-code过长 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:48,419 - test_bpm.py[line:50] - ERROR: 反向-code过短 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【t】在系统中已存在!","value":""} 用例数据:{'code': 't', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:48,737 - test_bpm.py[line:50] - ERROR: 反向-code重复 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm】在系统中已存在!","value":""} 用例数据:{'code': 'pkm', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:48,839 - test_bpm.py[line:50] - ERROR: 反向-code为特殊字符 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【♥♠♤♂♀★☆※】在系统中已存在!","value":""} 用例数据:{'code': '♥♠♤♂♀★☆※', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:48,951 - test_bpm.py[line:50] - ERROR: 反向-name过长 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm1', 'name': 'pokemonpokemonpokemonpokemonpokemon', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:49,070 - test_bpm.py[line:50] - ERROR: 反向-name过短 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm2', 'name': 'po', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:49,443 - test_bpm.py[line:50] - ERROR: 反向-name为特殊字符 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm4', 'name': '♥♠♤♂♀★☆※', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:49,555 - test_bpm.py[line:50] - ERROR: 反向-isDefault为-1 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm5', 'name': 'pokemon', 'isDefault': -1, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:49,665 - test_bpm.py[line:50] - ERROR: 反向-isDefault为2 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm6', 'name': 'pokemon', 'isDefault': 2, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-08 20:01:49,767 - test_bpm.py[line:50] - ERROR: 反向-isDefault不为整形 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"isDefault\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1722222894366343168"} 用例数据:{'code': 'pkm7', 'name': 'pokemon', 'isDefault': 'isDefault', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': 'Cannot deserialize value of type `java.lang.Integer` from String "isDefault": not a valid Integer value at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo["isDefault"])'} - ALuo
2023-11-08 20:01:49,920 - test_bpm.py[line:50] - ERROR: 反向-isDefault为特殊字符 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"※\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1722222895008071680"} 用例数据:{'code': 'pkm8', 'name': 'pokemon', 'isDefault': '※', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': 'Cannot deserialize value of type `java.lang.Integer` from String "※": not a valid Integer value at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo["isDefault"])'} - ALuo
2023-11-08 20:01:50,069 - test_bpm.py[line:50] - ERROR: 反向-msg过长 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm9', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-06 20:26:27,849 - read_excel.py[line:106] - ERROR: 用例数据获取失败 - ALuo
2023-11-06 20:26:27,849 - read_excel.py[line:106] - ERROR: 用例数据获取失败 - ALuo
2023-11-06 20:26:27,850 - read_excel.py[line:171] - ERROR: 获取excel表中数据失败,请查看是否存在空行,当前最大行:15 - ALuo
2023-11-06 20:28:27,085 - read_excel.py[line:106] - ERROR: 用例数据获取失败 - ALuo
2023-11-06 20:28:27,085 - read_excel.py[line:171] - ERROR: 获取excel表中数据失败,请查看是否存在空行,当前最大行:15 - ALuo
2023-11-06 20:29:54,275 - read_excel.py[line:106] - ERROR: 用例数据获取失败 - ALuo
2023-11-06 20:29:54,275 - read_excel.py[line:171] - ERROR: 获取excel表中数据失败,请查看是否存在空行,当前最大行:15 - ALuo
2023-11-06 20:30:16,160 - read_excel.py[line:118] - ERROR: 期望数据获取失败 - ALuo
2023-11-06 20:30:16,160 - read_excel.py[line:171] - ERROR: 获取excel表中数据失败,请查看是否存在空行,当前最大行:15 - ALuo
2023-11-07 09:01:13,243 - read_excel.py[line:106] - ERROR: 用例数据获取失败 - ALuo
2023-11-07 09:01:13,244 - read_excel.py[line:171] - ERROR: 获取excel表中数据失败,请查看是否存在空行,当前最大行:15 - ALuo
2023-11-07 09:01:51,434 - db.py[line:63] - ERROR: 数据库执行删除操作失败,请检查 - ALuo
2023-11-07 09:07:52,289 - test_bpm.py[line:27] - ERROR: {'code': 'pkm', 'name': 'pokemon', 'isDefault': 1, 'description': '测试57期的维度-测试专用'} - ALuo
2023-11-07 09:07:52,289 - db.py[line:62] - ERROR: 数据库语句执行错误 - ALuo
2023-11-07 09:09:40,180 - read_excel.py[line:130] - ERROR: sql数据获取失败 - ALuo
2023-11-07 09:09:40,180 - read_excel.py[line:171] - ERROR: 获取excel表中数据失败,请查看是否存在空行,当前最大行:15 - ALuo
2023-11-07 09:35:37,252 - test_bpm.py[line:47] - ERROR: 反向-code过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes】在系统中已存在!","value":""} 用例数据:{'code': 'pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:37,670 - test_bpm.py[line:47] - ERROR: 反向-code过短 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【t】在系统中已存在!","value":""} 用例数据:{'code': 't', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:37,789 - test_bpm.py[line:47] - ERROR: 反向-code重复 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm】在系统中已存在!","value":""} 用例数据:{'code': 'pkm', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:37,903 - test_bpm.py[line:47] - ERROR: 反向-code为特殊字符 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【♥♠♤♂♀★☆※】在系统中已存在!","value":""} 用例数据:{'code': '♥♠♤♂♀★☆※', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:38,041 - test_bpm.py[line:47] - ERROR: 反向-name过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm1】在系统中已存在!","value":""} 用例数据:{'code': 'pkm1', 'name': 'pokemonpokemonpokemonpokemonpokemon', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:38,226 - test_bpm.py[line:47] - ERROR: 反向-name过短 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm2】在系统中已存在!","value":""} 用例数据:{'code': 'pkm2', 'name': 'po', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:38,344 - test_bpm.py[line:47] - ERROR: 反向-name为空 断言失败,因为 {"state":false,"message":"添加维度信息失败,维度名称【name】必填!","logId":"1721702919436255232"} 用例数据:{'code': 'pkm3', 'name': '', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:38,513 - test_bpm.py[line:47] - ERROR: 反向-name为特殊字符 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm4】在系统中已存在!","value":""} 用例数据:{'code': 'pkm4', 'name': '♥♠♤♂♀★☆※', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:38,635 - test_bpm.py[line:47] - ERROR: 反向-isDefault为-1 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm5】在系统中已存在!","value":""} 用例数据:{'code': 'pkm5', 'name': 'pokemon', 'isDefault': -1, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:38,750 - test_bpm.py[line:47] - ERROR: 反向-isDefault为2 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm6】在系统中已存在!","value":""} 用例数据:{'code': 'pkm6', 'name': 'pokemon', 'isDefault': 2, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:38,867 - test_bpm.py[line:47] - ERROR: 反向-isDefault不为整形 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"isDefault\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1721702921613099008"} 用例数据:{'code': 'pkm7', 'name': 'pokemon', 'isDefault': 'isDefault', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:39,032 - test_bpm.py[line:47] - ERROR: 反向-isDefault为特殊字符 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"※\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1721702922271604736"} 用例数据:{'code': 'pkm8', 'name': 'pokemon', 'isDefault': '※', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
2023-11-07 09:35:39,250 - test_bpm.py[line:47] - ERROR: 反向-msg过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm9】在系统中已存在!","value":""} 用例数据:{'code': 'pkm9', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'} - ALuo
......@@ -17,4 +17,4 @@ log_file_level=error
;设置日志在文件中的信息格式
log_file_format=%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;设置文件日志中时间显示的格式
log_file_date_format=%年-%月-%日 %H:%M:%S
log_file_date_format=%Y-%m-%d %H:%M:%S
\ No newline at end of file
......@@ -23,8 +23,8 @@ def req_fix():
req = RequestMethod()
return req
# def pytest_collection_modifyitems(items):
# # item表示每个测试用例,解决用例名称中文显示问题
# for item in items:
# item.name = item.name.encode("utf-8").decode("unicode-escape")
# item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")
\ No newline at end of file
def pytest_collection_modifyitems(items):
# item表示每个测试用例,解决用例名称中文显示问题
for item in items:
item.name = item.name.encode("utf-8").decode("unicode-escape")
item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")
\ No newline at end of file
2023-11-07 09:35:37 - test_bpm.py[line:47] - ERROR: 反向-code过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes】在系统中已存在!","value":""} 用例数据:{'code': 'pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:47 - test_bpm.py[line:50] - ERROR: 反向-code过长 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:37 - test_bpm.py[line:47] - ERROR: 反向-code过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes】在系统中已存在!","value":""} 用例数据:{'code': 'pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:37 - test_bpm.py[line:47] - ERROR: 反向-code过短 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【t】在系统中已存在!","value":""} 用例数据:{'code': 't', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:37 - test_bpm.py[line:47] - ERROR: 反向-code重复 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm】在系统中已存在!","value":""} 用例数据:{'code': 'pkm', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:37 - test_bpm.py[line:47] - ERROR: 反向-code为特殊字符 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【♥♠♤♂♀★☆※】在系统中已存在!","value":""} 用例数据:{'code': '♥♠♤♂♀★☆※', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:38 - test_bpm.py[line:47] - ERROR: 反向-name过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm1】在系统中已存在!","value":""} 用例数据:{'code': 'pkm1', 'name': 'pokemonpokemonpokemonpokemonpokemon', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:38 - test_bpm.py[line:47] - ERROR: 反向-name过短 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm2】在系统中已存在!","value":""} 用例数据:{'code': 'pkm2', 'name': 'po', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:38 - test_bpm.py[line:47] - ERROR: 反向-name为空 断言失败,因为 {"state":false,"message":"添加维度信息失败,维度名称【name】必填!","logId":"1721702919436255232"} 用例数据:{'code': 'pkm3', 'name': '', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:38 - test_bpm.py[line:47] - ERROR: 反向-name为特殊字符 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm4】在系统中已存在!","value":""} 用例数据:{'code': 'pkm4', 'name': '♥♠♤♂♀★☆※', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:38 - test_bpm.py[line:47] - ERROR: 反向-isDefault为-1 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm5】在系统中已存在!","value":""} 用例数据:{'code': 'pkm5', 'name': 'pokemon', 'isDefault': -1, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:38 - test_bpm.py[line:47] - ERROR: 反向-isDefault为2 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm6】在系统中已存在!","value":""} 用例数据:{'code': 'pkm6', 'name': 'pokemon', 'isDefault': 2, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:38 - test_bpm.py[line:47] - ERROR: 反向-isDefault不为整形 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"isDefault\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1721702921613099008"} 用例数据:{'code': 'pkm7', 'name': 'pokemon', 'isDefault': 'isDefault', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:39 - test_bpm.py[line:47] - ERROR: 反向-isDefault为特殊字符 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"※\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1721702922271604736"} 用例数据:{'code': 'pkm8', 'name': 'pokemon', 'isDefault': '※', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-07 09:35:39 - test_bpm.py[line:47] - ERROR: 反向-msg过长 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm9】在系统中已存在!","value":""} 用例数据:{'code': 'pkm9', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:47 - test_bpm.py[line:50] - ERROR: 反向-code过长 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkmpkmpkmpkmpkmpkmtespkmpkmpkmpkmpkmpkmtes', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:48 - test_bpm.py[line:50] - ERROR: 反向-code过短 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【t】在系统中已存在!","value":""} 用例数据:{'code': 't', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:48 - test_bpm.py[line:50] - ERROR: 反向-code重复 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【pkm】在系统中已存在!","value":""} 用例数据:{'code': 'pkm', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:48 - test_bpm.py[line:50] - ERROR: 反向-code为特殊字符 断言失败,因为 {"state":false,"message":"添加维度失败,维度编码【♥♠♤♂♀★☆※】在系统中已存在!","value":""} 用例数据:{'code': '♥♠♤♂♀★☆※', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度-测试专用'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:48 - test_bpm.py[line:50] - ERROR: 反向-name过长 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm1', 'name': 'pokemonpokemonpokemonpokemonpokemon', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:49 - test_bpm.py[line:50] - ERROR: 反向-name过短 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm2', 'name': 'po', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:49 - test_bpm.py[line:50] - ERROR: 反向-name为特殊字符 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm4', 'name': '♥♠♤♂♀★☆※', 'isDefault': 0, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:49 - test_bpm.py[line:50] - ERROR: 反向-isDefault为-1 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm5', 'name': 'pokemon', 'isDefault': -1, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:49 - test_bpm.py[line:50] - ERROR: 反向-isDefault为2 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm6', 'name': 'pokemon', 'isDefault': 2, 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
2023-11-08 20:01:49 - test_bpm.py[line:50] - ERROR: 反向-isDefault不为整形 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"isDefault\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1722222894366343168"} 用例数据:{'code': 'pkm7', 'name': 'pokemon', 'isDefault': 'isDefault', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': 'Cannot deserialize value of type `java.lang.Integer` from String "isDefault": not a valid Integer value at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo["isDefault"])'}
2023-11-08 20:01:49 - test_bpm.py[line:50] - ERROR: 反向-isDefault为特殊字符 断言失败,因为 {"state":false,"message":" Cannot deserialize value of type `java.lang.Integer` from String \"※\": not a valid Integer value\n at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo[\"isDefault\"])","logId":"1722222895008071680"} 用例数据:{'code': 'pkm8', 'name': 'pokemon', 'isDefault': '※', 'description': '测试57期的维度'} 期望数据:{'state': False, 'message': 'Cannot deserialize value of type `java.lang.Integer` from String "※": not a valid Integer value at [Source: (PushbackInputStream); line: 1, column: 50] (through reference chain: com.hotent.uc.params.demension.DemensionVo["isDefault"])'}
2023-11-08 20:01:50 - test_bpm.py[line:50] - ERROR: 反向-msg过长 断言失败,因为 {"state":true,"message":"添加维度成功!","value":""} 用例数据:{'code': 'pkm9', 'name': 'pokemon', 'isDefault': 0, 'description': '测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度测试57期的维度'} 期望数据:{'state': False, 'message': '添加维度失败'}
......@@ -16,11 +16,12 @@ from interfaceAutoTest.common.read_excel import ReadExcel
class TestBPM:
read_excel = ReadExcel()
read_excel = ReadExcel("alin", "BPM-alin")
@allure.epic("BPM-ALin")
@pytest.mark.parametrize("case_module, case_api, case_title, case_level, case_url, "
"case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key, row", ReadExcel("BPM_add").get_datas())
"case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key, row",
read_excel.get_datas())
def test_bpm(self, db_fix, req_fix, case_module, case_api, case_title, case_level, case_url, case_method,
case_mime, case_data, expect_data, sql_type, sql_data, update_key, row):
# 判断sql语句是否为deleteReadExcel("BPM_add")
......@@ -45,12 +46,12 @@ class TestBPM:
for key in expect_data:
assert expect_data[key] == res.json()[key]
except:
ReadExcel("BPM_add").write_excel(result="断言失败", row=row)
TestBPM.read_excel.write_excel(result="断言失败", row=row)
alog.error(case_title + " 断言失败,因为 " + res.text + " 用例数据:" + str(case_data) + " 期望数据:" + str(expect_data))
raise AssertionError("断言失败")
else:
print("断言成功")
ReadExcel("BPM_add").write_excel(result="断言成功", row=row)
TestBPM.read_excel.write_excel(result="断言成功", row=row)
if __name__ == '__main__':
pytest.main()
......
......@@ -23,9 +23,8 @@ def req_fix():
req = RequestMethod()
return req
#
# def pytest_collection_modifyitems(items):
# # item表示每个测试用例,解决用例名称中文显示问题
# for item in items:
# item.name = item.name.encode("utf-8").decode("unicode-escape")
# item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")
def pytest_collection_modifyitems(items):
# item表示每个测试用例,解决用例名称中文显示问题
for item in items:
item.name = item.name.encode("utf-8").decode("unicode-escape")
item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")
\ 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