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

 

 

pytest设置logging级别的输出

 

 

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


pytest设置logging级别的输出

 

 pytest设置logging级别的输出

 

 

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

pytest设置logging级别的输出

 

 

 

相关文章:

  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-28
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案