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
相关推荐
开源优测12 小时前
使用pytest-xdist让自动化并行测试变得轻松简单
运维·自动化·pytest
测试的菜鸟1 天前
[pytest] 配置
python·pytest
互联网杂货铺2 天前
python+pytest 接口自动化测试:参数关联
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·pytest
挽风8213 天前
Pytest自动化框架
自动化·pytest·模块测试
Xiaoshuang_Cao3 天前
pytest结合allure
pytest
摸鱼仙人~4 天前
结合unittest和pytest进行虚拟数据库测试
数据库·windows·pytest
江梦寻6 天前
如何使用 Python+Flask+win32print 实现简易网络打印服务
开发语言·后端·python·flask·pytest·web3.py·win32
qq_白羊座6 天前
pytest框架 核心知识的系统复习
pytest
@TangXin7 天前
单元测试-pytest框架实践
自动化测试·单元测试·pytest
evelol77 天前
【pytest框架源码分析四】pluggy源码分析之hook执行
自动化·pytest