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
相关推荐
淼_@淼21 小时前
pytest-数据驱动
pytest
我的xiaodoujiao1 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 27--二次封装方法--优化断言结果
python·学习·测试工具·pytest
淼_@淼4 天前
pytest简介
运维·服务器·pytest
奶茶精Gaaa4 天前
【ZJ】Pytest框架搭建
pytest
趙卋傑5 天前
接口自动化测试
python·pycharm·pytest
测试界萧萧7 天前
Jenkins+Allure+Pytest的持续集成
自动化测试·软件测试·功能测试·程序人生·ci/cd·jenkins·pytest
nvd117 天前
Pytest 中使用 SQLAlchemy 进行异步数据库测试
数据库·oracle·pytest
文人sec8 天前
pytest1-接口自动化测试场景
软件测试·python·单元测试·pytest
我的xiaodoujiao8 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 25--数据驱动--参数化处理 Excel 文件 2
前端·python·学习·测试工具·ui·pytest