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的前置与后置
开发语言·python·pytest
测试老哥3 天前
pytest+requests+allure自动化测试接入Jenkins学习
自动化测试·软件测试·学习·测试工具·职场和发展·jenkins·pytest
丿罗小黑3 天前
Pytest项目_day20(log日志)
pytest
xt19892883 天前
pytest+yaml+allure接口自动化测试框架
自动化测试·pytest·接口自动化·框架封装
灰阳阳3 天前
接口自动化测试大全(python+pytest+allure)
python·pytest·接口自动化·allure
5:005 天前
pytest框架-详解
pytest
丿罗小黑7 天前
Pytest项目_day15(yaml)
pytest
丿罗小黑8 天前
Pytest项目_day16(yaml和parametrize结合)
pytest
代码小念8 天前
Pytest+selenium UI自动化测试实战实例(超详细)
selenium·ui·pytest
丿罗小黑9 天前
Pytest项目_day11(fixture、conftest)
pytest