首页 > 其他 > 详细

pytest框架

时间:2020-08-18 18:35:38      阅读:68      评论:0      收藏:0      [点我收藏+]

1.添加日志

import logging

logging.debug(This is debug message)
logging.info(This is info message)
logging.warning(This is warning message)
import logging

logging.basicConfig(level=logging.DEBUG)

def test_1():
    log = logging.getLogger(test_1)
    time.sleep(1)
    log.debug(after 1 sec)
    time.sleep(1)
    log.debug(after 2 sec)
    time.sleep(1)
    log.debug(after 3 sec)
    assert 1, should pass

2.代码覆盖率

安装

pip install pytest-cover

 

pytest框架

原文:https://www.cnblogs.com/wangxue1314/p/13524866.html

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