![](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 · 2356 阅读 · 0 评论 -
pytest框架学习(二) - pytest-html报告与fixture使用以及conftest.py文件
优化 - pytest - html 需要安装pytest - html插件 pytest可以生成多种样式的结果 1.生成 JunitXML 格式的测试报告: 命令: --junitxml=path 2.生成result log格式的测试报告: 命令: --resultlog=report\log.txt 3.生成html格式的测试报告: 命令: --html=report\test_o...原创 2019-07-02 23:20:09 · 838 阅读 · 0 评论 -
pytest框架学习(三) - 测试用例
简单的登录用例: from pageObjects.index_page import IndexPage from testDatas import login_datas as ld import pytest @pytest.mark.login @pytest.mark.usefixtures("init_driver") class TestLogin(): # 正常场景...原创 2019-07-03 21:45:58 · 231 阅读 · 0 评论 -
pytest框架学习(四) - 重运行机制
pytest重运行机制 pytest提供了失败重运行机制 安装方法: pip install pytest-rerunfailures 使用方法: 命令行参数形式: 命令:pytest --reruns 重复次数 比如:pytest --reruns 2 表示:运行失败的用例可以重新运行2次 命令:pytest --reruns 重复次数 --reruns-delay 次数之间...原创 2019-07-03 22:33:43 · 815 阅读 · 0 评论 -
pytest框架学习(五) - allure报告
allure文档:https://docs.qameta.io/allure/ 安装allure命令行: 如果是ubuntu:如下安装,如果是其他的,请源码安装,请跳转:https://bintray.com/qameta/generic/allure2 sudo apt-add-repository ppa:qameta/allure sudo apt-get update sudo a...转载 2019-07-07 11:42:50 · 441 阅读 · 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 · 584 阅读 · 0 评论