xfail专题

pytest中文使用文档----10skip和xfail标记

1. 跳过测试用例的执行 1.1. @pytest.mark.skip装饰器1.2. pytest.skip方法1.3. @pytest.mark.skipif装饰器1.4. pytest.importorskip方法1.5. 跳过测试类1.6. 跳过测试模块1.7. 跳过指定文件或目录1.8. 总结 2. 标记用例为预期失败的 2.1. 去使能xfail标记 3. 结合pytest.param方

24、pytest通过xfail将测试函数标记为预期失败

官方实例 # content of test_xfail.pyimport pytestimport sys@pytest.mark.xfaildef test_function():print("test_function was invoked.")def valid_config():return Falsedef test_function_02():if not valid_co

24、pytest通过xfail将测试函数标记为预期失败

官方实例 # content of test_xfail.pyimport pytestimport sys@pytest.mark.xfaildef test_function():print("test_function was invoked.")def valid_config():return Falsedef test_function_02():if not valid_co