Pytest配置文件pytest.ini如何编写生成日志文件?

1、新建pytest.ini文件

python 复制代码
[pytest]
log_cli=true
log_leveL=NOTSET
log_format = %(asctime)s %(levelname)s %(message)s %(filename)s %(funcName)s %(lineno)d
log_date_format = %Y-%m-%d %H:%M:%S

log_file = ./logdata/log.log
log_file_level = info
log_file_format = %(asctime)s %(levelname)s %(message)s %(filename)s %(funcName)s %(lineno)d
log_file _date_format = %Y-%m-%d %H:%M:%S

关闭日志

复制代码
log_cli=true 改成 log_cli=false
相关推荐
啊森要自信1 小时前
【GUI自动化测试】YAML 配置文件应用:从语法解析到 Python 读写
android·python·缓存·pytest·pip·dash
我的xiaodoujiao5 小时前
从 0 到 1 搭建完整 Python 语言 Web UI自动化测试学习系列 17--测试框架Pytest基础 1--介绍使用
python·学习·测试工具·pytest
程序员杰哥1 天前
Pytest与Unittest测试框架对比
自动化测试·软件测试·python·测试工具·测试用例·excel·pytest
软件测试小仙女1 天前
Pytest参数化实战:高效测试API接口
软件测试·测试开发·测试工具·pytest·接口测试·api·参数化
子正1 天前
Pytest单元测试一例:u16采样值格式转换的错误
单元测试·pytest
cllsse2 天前
pytest学习
软件测试·python·pytest
Test.X3 天前
学习16天:pytest学习
学习·pytest
唐古乌梁海4 天前
【pytest 】 pytest 生命周期
pytest
专职5 天前
pytest详细教程
开发语言·python·pytest
乄捷径5 天前
pytest入门到熟练
pytest