pytest设置logging级别的输出

写脚本过程中发现,需要设置pytest的日志输出级别,在pytest-html测试报告上才会显示铺捉到并显示相应的日志内容,具体方法如下

 

 

 

 

 参考地址:https://docs.pytest.org/en/stable/logging.html


 

 

 

 

pytest --log-format="%(asctime)s %(levelname)s %(message)s" \
        --log-date-format="%Y-%m-%d %H:%M:%S"

 

 

 
posted @ 2020-11-23 16:23  乐乐熊小妹  阅读(1347)  评论(0)    收藏  举报