pytest学习和使用14-Pytest用例执行结果有哪几种状态?

14-Pytest用例执行结果有哪几种状态?

1 用例执行状态

状态 说明
passed 测试通过
failed 断言失败
error 用例本身代码报错
xfail 预期失败,加了 @pytest.mark.xfail()

2 xfail示例

# -*- coding:utf-8 -*-
# 作者:NoamaNelson
# 日期:2022/12/27 
# 文件名称:test_case_status.py
# 作用࿱
posted @ 2022-12-27 10:38  虫无涯  阅读(20)  评论(0)    收藏  举报  来源