美文网首页
pytest标记函数

pytest标记函数

作者: 成功在于实践 | 来源:发表于2020-11-29 00:06 被阅读0次
import pytest
#显示的指定函数名,通过::标记
# xxx.py:函数名
def test_001():
    print('test01')
def test_003():
    print('test03')
def test_002():
    print('test02')

第1种

image.png

第2种

image.png

第3种

[pytest]
markers=
    do:webtest
    undo:apptest


import pytest
'''
pytest标记函数
'''
@pytest.mark.do
def test01():
    print('webtest')

@pytest.mark.undo
def test02():
    print('apptest')

image.png

相关文章

网友评论

      本文标题:pytest标记函数

      本文链接:https://www.haomeiwen.com/subject/dqrhwktx.html