08、分析测试执行时间及获取pytest帮助

官方用例

python 复制代码
# content of test_slow_func.py
import pytest
from time import sleep

@pytest.mark.parametrize('delay',(1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,1.0,0.1,0.2,0,3))
def test_slow_func(delay):
    print("test_slow_func {}".format(delay))
    sleep(delay)
    assert 1

解读与实操

  • 查询pytest版本号
  • 查询所有pytest的fixture
  • 查询所有pytest的帮助

应用场景

  • 遇到新场景,想查看下pytest中是否有相应实现。
  • 看到其他人使用了某个特性,要了解相关用法

以上两种场景,都可以通过pytest -h 帮助,要查询或了解。

相关推荐
春日见1 天前
TEST文件夹:Pytest,集成测试,单元测试
服务器·人工智能·驱动开发·单元测试·计算机外设·集成测试·pytest
TRACER~851 天前
项目实战:pandas+pytest+allure+adb
adb·pandas·pytest
Franciz小测测2 天前
Pytest 并发分组执行引擎(支持UI / 接口自动化测试):从设计到工程落地
pytest
小猪咪piggy3 天前
【接口自动化】(2) pytest 测试框架
运维·自动化·pytest
忘忧记3 天前
Pytest + Requests + YAML 数据驱动+日志模块
网络·python·pytest
清水白石0084 天前
pytest Fixture 设计实战指南:作用域、依赖链、自动清理与测试资源高效复用
python·pytest
亚马逊云开发者5 天前
Amazon Nova Act 浏览器自动化测试实战:AI 驱动的端到端测试 + pytest 集成 + OpenClaw 场景落地
人工智能·pytest
cendy-LL6 天前
自动化测试之Pytest框架
pytest
我的xiaodoujiao6 天前
API 接口自动化测试详细图文教程学习系列7--相关Python基础知识6
python·学习·测试工具·pytest
忘忧记6 天前
pytest + YAML + requests`简单实例化
网络·pytest