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

相关推荐
cendy-LL1 天前
自动化测试之Pytest框架
pytest
我的xiaodoujiao2 天前
API 接口自动化测试详细图文教程学习系列7--相关Python基础知识6
python·学习·测试工具·pytest
忘忧记2 天前
pytest + YAML + requests`简单实例化
网络·pytest
我的xiaodoujiao2 天前
API 接口自动化测试详细图文教程学习系列8--测试接口
python·学习·测试工具·pytest
鹿鸣悠悠4 天前
pytest + requests + allure 接口自动化测试框架指南
pytest
忘忧记4 天前
pytest进阶参数化用法
前端·python·pytest
bug_rabbit4 天前
pytest-html 中文乱码问题终极解决方案(Windows版)
windows·html·pytest
庄小法4 天前
pytest
开发语言·python·pytest
工具人55555 天前
pytest练习
pytest
好家伙VCC5 天前
# Pytest发散创新:从基础测试到智能断言的实战进阶指南在现代软
java·python·pytest