Python+pytest+allure 环境搭建

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

posted @ 2020-07-24 14:20  幸福就这么简单  阅读(664)  评论(0)    收藏  举报