1、测试用例分类
1、有时候我们只需执行部分测试用例,比如从用例集当中挑选 smoke 测试,要怎么做呢?
2、通过装饰器 @pytest.mark.smoke,smoke 是可以自定义的,运行时加上命令‘-m=smoke’,pytest 就会挑选带有装饰器的类或函数运行。
2、代码演示
import pytest
@pytest.mark.smoke
def test_sum(login):
token = login[0]
guid = login[1]
print(token)
print(guid)
def test_2