![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytest
夜莺_Cody
这个作者很懒,什么都没留下…
展开
-
pytest框架学习(一) - pytest安装与mark功能
一.pytest 介绍pytest:基于 unittest 之上的单元测试框架1.自动发现测试模块和测试方法2.断言使用 assert +表达式即可3.可以设置会话级\模块级\类级\函数级fixtures 数据准备+清理工作4.有丰富的插件库,目前在 600 个以上安装命令pip install pytest安装 HTML 报告的插件pip instal...原创 2019-06-26 23:14:21 · 2362 阅读 · 0 评论 -
pytest框架学习(二) - pytest-html报告与fixture使用以及conftest.py文件
优化 - pytest - html需要安装pytest - html插件pytest可以生成多种样式的结果1.生成 JunitXML 格式的测试报告: 命令: --junitxml=path2.生成result log格式的测试报告: 命令: --resultlog=report\log.txt3.生成html格式的测试报告: 命令: --html=report\test_o...原创 2019-07-02 23:20:09 · 847 阅读 · 0 评论 -
pytest框架学习(三) - 测试用例
简单的登录用例:from pageObjects.index_page import IndexPagefrom testDatas import login_datas as ldimport pytest@pytest.mark.login@pytest.mark.usefixtures("init_driver")class TestLogin(): # 正常场景...原创 2019-07-03 21:45:58 · 232 阅读 · 0 评论 -
pytest框架学习(四) - 重运行机制
pytest重运行机制pytest提供了失败重运行机制安装方法:pip install pytest-rerunfailures使用方法:命令行参数形式:命令:pytest --reruns 重复次数比如:pytest --reruns 2 表示:运行失败的用例可以重新运行2次命令:pytest --reruns 重复次数 --reruns-delay 次数之间...原创 2019-07-03 22:33:43 · 819 阅读 · 0 评论 -
pytest框架学习(五) - allure报告
allure文档:https://docs.qameta.io/allure/安装allure命令行:如果是ubuntu:如下安装,如果是其他的,请源码安装,请跳转:https://bintray.com/qameta/generic/allure2sudo apt-add-repository ppa:qameta/alluresudo apt-get update sudo a...转载 2019-07-07 11:42:50 · 445 阅读 · 0 评论 -
pytest框架学习(六) - pytest.ini
1.前言pytest配置文件可以改变pytest的运行方式,它是一个固定的文件pytest.ini文件,读取配置信息,按指定的方式去运行。2.ini配置文件pytest里面有些文件是非test文件pytest.ini pytest的主配置文件,可以改变pytest的默认行为 conftest.py 测试用例的一些fixture配置 init.py 识别该文件夹为python的p...转载 2019-09-16 13:13:26 · 588 阅读 · 0 评论