【pytest】跳过之函数内部skip
建议使用场景:setup执行失败,但是后续用例不想被当作执行失败(error)识别时
# !/usr/bin/python3
# -*- coding:utf-8 -*-
import pytest
class TestCreateMoments:
def setup_class(self):
pytest.skip('skip')
print('setup')
def test_1t(self):
print(1)
def test_2(self):
print(2)
def teardown_class(self):
print('teardown')
python自动化 文章被收录于专栏
python写好pytest自动化的一些小妙招
叮咚买菜工作强度 199人发布