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 帮助,要查询或了解。

相关推荐
Tom Boom2 天前
Pytest断言全解析:掌握测试验证的核心艺术
自动化测试·python·测试开发·pytest
不要一直敲门4 天前
初学 pytest 记录
pytest
测试界清流4 天前
Selenium4+Pytest自动化测试框架
selenium·测试工具·pytest
努力搬砖的咸鱼6 天前
从零开始搭建 Pytest 测试框架(Python 3.8 + PyCharm 版)
python·pycharm·pytest
FINE!(正在努力!)8 天前
PyTest框架学习
学习·pytest
程序员杰哥9 天前
接口自动化测试之pytest 运行方式及前置后置封装
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·pytest
测试老哥9 天前
Pytest+Selenium UI自动化测试实战实例
自动化测试·软件测试·python·selenium·测试工具·ui·pytest
水银嘻嘻9 天前
07 APP 自动化- appium+pytest+allure框架封装
python·appium·自动化·pytest
天才测试猿10 天前
接口自动化测试之pytest接口关联框架封装
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·pytest
not coder11 天前
Pytest Fixture 详解
数据库·pytest