我们利用参数化,当传入的参数有中文的时候,展示的是\u6d4b 这样的编码,而不是显示我们要的中文,allure里面展示的也是编码。
如下代码为测试用例,ids=test_expend_data.test_smokecase_titles 传入的是中文
import pytest
import allure
from common.ComLog import LOGGER
from testdata import test_expend_data
@allure.epic("记账模块测试")
@allure.feature("支出功能的测试")
class TestExpendClass:
"""
支出测试用例类
"""
@pytest.mark.parametrize('test_somke_data',test_expend_data.test_somke_datas,ids=test_expend_data.test_smokecase_titles)
@pytest.mark.smoke
def test_expend_smoke(self,test_somke_data):
"""记账冒烟测试用例
"""
print(test_somke_data)
with allure.step("步骤1.1 记账前记录初始值,流水初始值"):
pass
with allure.step("步骤1.2 记账前记录初始值,账户初始值"):
pass
with allure.step("步骤1.3 记账前记录初始值,图表初始值"):
pass
wit