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 天前
如何在 Pytest 中调用其他用例返回的接口参数?
面试·自动化·pytest·接口·接口测试·api测试
思则变2 天前
[Pytest][Part 4]多种测试运行方式
pytest
程序员三藏2 天前
如何使用Pytest进行测试?
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·pytest
一个处女座的测试4 天前
Python语言+pytest框架+allure报告+log日志+yaml文件+mysql断言实现接口自动化框架
python·mysql·pytest
思则变7 天前
[Pytest][Part 1]Pytest 自动化测试框架
pytest
思则变9 天前
[Pytest] [Part 2]增加 log功能
开发语言·python·pytest
思则变10 天前
[Pytest][Part 3]检测python package状态
pytest
cooldream200923 天前
pytest 框架详解与实战指南
pytest·测试
慕城南风23 天前
【pytest进阶】Pytest之conftest详解
pytest