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"

 
原文地址:https://www.cnblogs.com/lelexiong/p/14025172.html