pytest.mark.xfail
时间: 2023-10-31 07:57:25 浏览: 158
pytest.mark.xfail是一个标记,用于标识预期失败的测试用例。当一个测试用例被标记为@pytest.mark.xfail时,测试框架会将其视为一个预期失败的用例,并不会将其视为测试失败。这个标记的作用是告诉测试框架,这个用例预计会失败,如果用例确实失败了,就不会将其报告为测试失败。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [『德不孤』Pytest框架 — 6、Pytest预期失败](https://blog.csdn.net/Liuyuelinjiayou/article/details/114387545)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [学习pytest的第八天-----xfail的使用](https://blog.csdn.net/qq_39721240/article/details/88761678)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文