加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

pytest输出日志

(2023-05-02 21:30:49)
标签:

日志

pytest

分类: python/深度学习
https://mp.weixin.qq.com/s/u2Ww8EpZoRG78Dr2LSqqbg

两种方式:pytest配置文件、装饰器
配置文件上面是输出到控制台,下面是输出到文件

[pytest]
log_cli = 1
log_cli_level = INFO
log_cli_date_format = %Y-%m-%d-%H-%M-%S
log_cli_format = %(asctime)s - %(filename)s - %(module)s - %(funcName)s - %(lineno)d - %(levelname)s - %(message)s
log_file = ./log/run.log
log_file_level = INFO
log_file_date_format = %Y-%m-%d-%H-%M-%S
log_file_format = %(asctime)s - %(filename)s - %(module)s - %(funcName)s - %(lineno)d - %(levelname)s - %(message)s

pytest输出日志




0

阅读 收藏 喜欢 打印举报/Report
前一篇:python内置diff
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有