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

相关推荐
我的xiaodoujiao20 小时前
API接口自动化测试详细图文教程学习系列1--序章
python·学习·pytest
我的xiaodoujiao1 天前
API 接口自动化测试详细图文教程学习系列2--相关Python基础知识
python·学习·测试工具·pytest
H_unique2 天前
博客接口自动化测试--搭建测试环境&库的介绍&安装allure
python·pytest·测试
真智AI2 天前
MCP+pytest自动重构回归:复刻ARIS循环
重构·pytest
零基础的修炼3 天前
自动化测试---pytest
pytest
鲜于言悠9054 天前
博客系统测试报告
python·功能测试·selenium·jmeter·测试用例·集成测试·pytest
0和1的舞者5 天前
高并发论坛系统:单元测试 + 接口自动化 + 性能测试 + CI/CD 全链路测试报告
java·测试开发·测试工具·jmeter·pytest·测试·测试报告
独断万古他化5 天前
Python+Pytest 搭建博客系统接口自动化测试框架(全用例执行+完整代码)
pytest·接口自动化·测试·allure·requests
王夏奇5 天前
python-pytest学习
python·学习·pytest
独断万古他化6 天前
Python 接口测试之 requests 库核心用法
python·pytest·接口测试·requests