随笔分类 -  pytest

摘要:1. 钩子:pytest_terminal_summary 执行完测试用例后,需要对结果进行汇总,用例总数,失败用例数,成功用例数等。 pytest有自带的一个钩子函数:pytest_terminal_summary,查看官方文档。 # conftest.py def pytest_terminal 阅读全文
posted @ 2024-01-23 14:43 dack_deng 阅读(78) 评论(0) 推荐(0) 编辑
摘要:1. 用例等级 用例的严重等级大致分为以下几种: BLOCKER = 'blocker' CRITICAL = 'critical' NORMAL = 'normal' MINOR = 'minor' TRIVIAL = 'trivial' # test_allure.py import allur 阅读全文
posted @ 2024-01-19 20:06 dack_deng 阅读(37) 评论(0) 推荐(0) 编辑
摘要:1. Allure环境搭建 Allure报告需要安装2个包,一个包是pytest第三方allure库:pip install allure-pytest。第二个是Allure的命令行工具:allure-commandline-2.13.0,其中第二个包是Allure报告的服务器环境,打开报告需要用到 阅读全文
posted @ 2024-01-19 15:42 dack_deng 阅读(47) 评论(0) 推荐(0) 编辑
摘要:前言 pytest内置fixture是框架自带的一些fixtures,我们可以直接在用例中使用。参考官方文档:https://docs.pytest.org/en/7.3.x/reference/reference.html 进入到官方文档,我们可以看到有许多内置fixtures,其中最重要的一个内 阅读全文
posted @ 2024-01-11 20:09 dack_deng 阅读(256) 评论(0) 推荐(0) 编辑
摘要:#pytest-xdist基本的介绍 声明:在介绍pytest-xdist时,本人不讲任何原理,需要看原理的请移至官方:https://pypi.org/project/pytest-xdist/ 当我们自动化测试用例非常多的时候, 一条条按顺序执行会非常慢,pytest-xdist的出现就是为了让 阅读全文
posted @ 2022-01-18 18:48 dack_deng 阅读(414) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示