pytest输出日志
标签:
日志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
前一篇:python内置diff
后一篇:pytest的配置文件

加载中…