a,python文件需要以“test_”为开头,或者以“_test”为结尾。
b,创建类时,需要以“Test”为开头
c,定义函数时,需要以“test”为开头
2,参数化用例@pytest.mark.parametrize(
"a, b, expect, title",
yaml.safe_load(open("./datas/add_data.yaml",encoding='utf-8'))
)
a, b, expect, title为测试用例中可以使用的参数,按照yaml文件中的格式依次使用。
3,设置标题
@allure.feature("加法测试用例")
4,断言
assert result == expect 左边为实际值,右边为预期值



