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
相关推荐
007张三丰1 天前
软件测试专栏(11/20):测试框架开发:pytest深度解析与插件体系
运维·服务器·自动化测试·pytest·测试框架
我的xiaodoujiao2 天前
API 接口自动化测试详细图文教程学习系列25--继续处理testCase中的数据
python·学习·测试工具·pytest
xiaobai1783 天前
pytest+playwright实现UI自动化(4)-上夹具fixture
ui·自动化·pytest·playwright
弹简特3 天前
【接口自动化】02-Pytest固件fixture核心机制与Allure企业级报告实战
自动化·pytest·测试
弹简特5 天前
【接口自动化】01-pytest详解、pytest执行逻辑、pytest参数、配置文件和pytest标记
自动化·pytest
香辣西红柿炒蛋5 天前
pytest框架介绍
python·pytest
我的xiaodoujiao11 天前
API 接口自动化测试详细图文教程学习系列24--如何用Pytest去设计接口测试用例并执行
python·学习·测试工具·pytest
我的xiaodoujiao11 天前
API 接口自动化测试详细图文教程学习系列23--结合Pytest框架使用4-前后置处理
python·学习·测试工具·pytest
wanglei20070812 天前
pytest自动化测试框架项目架构
pytest
词元Max15 天前
2.12 pytest 实战:如何测试 AI 应用
人工智能·pytest