pytest高级用法之mark

pytest高级用法之mark

mark给用例标记不同标签,实现用例筛选

①注册标记:项目根目录下新建pytest.ini文件,添加配置

[pytest]markers =bvtP0P1P2

 

image

 

②打上标记

image

 

③筛选标记:

运行单个标记 :

pytest -m bvt

 

image

 

运行多个标记 :

 pytest -m "bvt or P1"

 

image