Python+pytest+allure 环境搭建

Posted 幸福就这么突然

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

以上是关于Python+pytest+allure 环境搭建的主要内容,如果未能解决你的问题,请参考以下文章