Python+pytest+allure 环境搭建

时间:2020-07-24 16:27:58   收藏:0   阅读:86

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

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!