跳过:

import pytest
def test_case_01():
assert 1

#无条件跳过类:
@pytest.mark.skip()
class TestCase(object):
"""加装饰器跳过测试用例"""
@pytest.mark.skip(condition=True, reason="我就想跳过")
def test_case_01(self):
assert 1

#用skip就是无条件跳过:
@pytest.mark.skip(condition=1 > 2, reason="我就想跳过")
def test_case_02(self):
assert {"title":"v2ex"} != {"title":"V2EX"}

def test_case_03(self):
assert 1
#skipif就是有条件跳过:
@pytest.mark.skipif(condition=1 < 2, reason="我就想跳过")
def test_case_04(self):
assert 1
posted @ 2020-01-20 20:25  干it的小张  阅读(243)  评论(0编辑  收藏  举报