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

相关推荐
唐古乌梁海19 小时前
【pytest】编写自动化测试用例命名规范README
自动化·pytest
xing251620 小时前
pytest下allure
开发语言·python·pytest
IT求学人2 天前
pytest运行用例的常见方式及参数
pytest
开源优测3 天前
什么是pytest.ini及如何在Pytest中应用以提升配置效率
pytest
摸鱼仙人~4 天前
ImportError: cannot import name ‘FixtureDef‘ from ‘pytest‘
conda·pytest·fastapi
唐古乌梁海4 天前
【pytest-jira】自动化用例结合jira初版集成思路
pytest·jira
小码哥说测试5 天前
高效执行自动化用例:分布式执行工具pytest-xdist实战!
自动化测试·软件测试·功能测试·jmeter·pytest·postman·测试工程师
予早6 天前
pytest asyncio 支持插件 pytest-asyncio
pytest