入门7-pytest跳过测试用例

1.无条件跳过用例

@pytest.mark.skip(reason="无理由跳过")

2.有条件跳过用例

@pytest.mark.skipif(workage<5,reason="无理由跳过")

    @pytest.mark.skipif(workage<5,reason="有理由跳过")
    def test_company(self):    
        print("this is company")

    @pytest.mark.skip(reason="无理由跳过")
    def test_company2(self):
        print("this is company 2")

 

 

posted @ 2023-05-07 21:06  蜗牛果果  阅读(27)  评论(0编辑  收藏  举报