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"

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM