1、allure环境配置
Pytest 参数化(数据驱动)
# 待测函数 def add(a, b): return a + b
# 测试类参数化
@pytest.mark.parametrize('a, b, c', [(1,2,3), (4,5,9)])
class TestAdd():
def test_add1(self, a, b, c):
assert add(a, b) == c
def test_add2(self, a, b, c):
assert add(a, b) == c