pytest标记函数

2020-11-29  本文已影响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
上一篇 下一篇

猜你喜欢

热点阅读