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
相关推荐
2601_967987373 天前
Python在自动化测试中有哪些应用?
python自动化测试·selenium·appium·pytest·性能测试
Madison-No78 天前
pytest框架
pytest
凛铄linshuo13 天前
分析业务流程什么时候适合断言?
python·pytest
凛铄linshuo14 天前
自动化测试:pytest第一个实例学习
学习·pytest
Helix25017 天前
Python单元测试实战:pytest框架从入门到企业级测试体系搭建指南
python·单元测试·实战·mock·pytest·测试覆盖率·fixture
在世修行21 天前
干货:pytest
pytest·fixture·pytest assert
小小龙学IT23 天前
Python pytest 测试框架深度解析:从断言重写到插件生态的工程化测试体系
网络·python·pytest
落魄大学生之流水线上谋生计25 天前
pytest 入门与实践:从第一个测试到可维护的测试体系
pytest
念越1 个月前
Allure 测试报告保姆级教程:从安装到 pytest 集成与报告生成
pytest·allure
念越1 个月前
接口自动化测试从入门到实战:接口用例设计、Requests、Pytest、YAML、JSON Schema 与 Allure 报告
python·测试工具·自动化·json·pytest