pytest_按标记执行

Posted qastudy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pytest_按标记执行相关的知识,希望对你有一定的参考价值。

import pytest
@pytest.mark.webtest
def test_send_http():
pass

@pytest.mark.apptest
def test_devide():
pass

@pytest.mark.android
def test_search():
pass

@pytest.mark.ios
def test_add():
pass

def test_plus():
pass

-m 是标记
-s 显示内部打印信息

pytest -s test_mark.py -m ‘not ios‘ 执行标记不等于ios的

pytest -s test_mark.py -m ios  只执行标记==ios的

pytest -s test_mark.py -m=ios  只执行标记==ios的

以上是关于pytest_按标记执行的主要内容,如果未能解决你的问题,请参考以下文章