首页 > 其他 > 详细

pytest运行方式

时间:2020-03-17 22:39:32      阅读:71      评论:0      收藏:0      [点我收藏+]

pytest有几种运行方式

1.全量方式运行

pytest  测试py文件

2.部分方法运行

pytest test_mod.py::test_func

3.运行时显示详细日志

pytest test_mod.py::test_func  -v  -s

案例展示

全量方式运行

def test_demo1():
    print("run demo1------------")
    assert True

def test_demo2():
    print("run demo2-----------")
    assert  True

 技术分享图片

 

部分方法运行

 技术分享图片

 

 详细信息显示

技术分享图片

 

pytest运行方式

原文:https://www.cnblogs.com/chongyou/p/12513888.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!