pytest---pytest.ini

完整:ini中的参数设置

  Configuration Options

 

1,格式

1
2
3
4
[pytest]
log_format = %(asctime)s %(levelname)s %(message)s
 
log_date_format = %Y-%m-%d %H:%M:%S

  

 

2,addopts

  添加运行参数

  addopts = -q

 

3,testpaths

  指定测试用例路径

  testpaths = app/login 

 

  多个测试路径使用 空格隔开或者换行写

1
2
3
# testpaths = app/login app/persontestpaths =
    app/login
    app/person

  

 

4,日志信息设置 

1
log_file

 

 

5,对警告信息进行配置

1
2
3
4
[pytest]
filterwarnings =
    error
    ignore::UserWarning

  

6,对doctest文件的设置

1
2
[pytest]
addopts = --doctest-modules

  

 

 

  

posted @   myy2  阅读(133)  评论(0编辑  收藏  举报
编辑推荐:
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
· ASP.NET Core 模型验证消息的本地化新姿势
阅读排行:
· 从零开始开发一个 MCP Server!
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· Ai满嘴顺口溜,想考研?浪费我几个小时
· Browser-use 详细介绍&使用文档
点击右上角即可分享
微信分享提示