D88【python 接口自动化学习】- pytest基础用法

day88 pytest运行参数-q -s -v

学习日期:20241203

学习目标:pytest基础用法 -- pytest运行参数-q -s -v&pytest使用ini配置指定运行参数

学习笔记:

pytest -q
  • 说明:简化控制台的输出
python 复制代码
pytest -q .\testcases\test_requests.py
pytest -v
  • 可以输出用例更加详细的执行信息
python 复制代码
pytest -v .\testcase\test_requests.py
pytest -s
  • 输出我们用例中的调试信息

    pytest -s .\testcase\test_requests.py

pytest使用ini配置指定运行参数
python 复制代码
[pytest]
testpaths=./testcase
markers=
    p0=高优先级
    test=测试环境
    pro=生产环境

addopts:-s

然后Terminal里输入 pytest .\testcase\test_requests.py

总结
  1. pytest -q 说明:简化控制台的输出
  2. pytest -v 可以输出用例更加详细的执行信息
  3. pytest -s 输出我们用例中的调试信息
  4. pytest使用ini配置指定运行参数
相关推荐
酷爱码1 分钟前
Python虚拟环境与Conda的使用方式详解
开发语言·python·算法
大模型真好玩9 分钟前
GRPO 代码实战!让大模型具备思维能力,打造你的专属DeepSeek
人工智能·python·deepseek
码海漫游者812 分钟前
让Python成为你的网站引擎:Django全栈开发初体验!!!
数据库·python·其他·django
秋山落叶万岭花开ღ24 分钟前
树的基本概念与操作:构建数据结构的层级世界
数据结构·python·算法
山花44 分钟前
什么是“Pythonic”?——写出更优雅的Python代码(上)
后端·python
Humbunklung2 小时前
全连接层和卷积层
人工智能·python·深度学习·神经网络·机器学习·cnn
站大爷IP2 小时前
使用Python时要注意的十大陷阱
python
Keya2 小时前
使用 tinypng 脚本打包为exe 进行压缩图片
前端·python·程序员
Tom Boom2 小时前
Pytest断言全解析:掌握测试验证的核心艺术
自动化测试·python·测试开发·pytest
Jamesvalley3 小时前
【Django】性能优化-普通版
python·性能优化·django