pytest allure
文章平均质量分 86
LI~友
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Pytest的常用插件(五)
Pytest插件pytest插件列表:https://plugincompat.herokuapp.comPytest测试报告(pytest-html)安装:pip3 install pytest-html命令行格式:pytest --html=用户路径/report.html配置文件:addopts = -s --html=./report.htmlPytest执行顺序安装: pi...原创 2019-11-28 10:38:17 · 317 阅读 · 0 评论 -
pytest的fixture的使用(四)
pytest的fixture的使用1、@fixture(scope=‘function’, params=None, autouse=False, ids=None, name=None)scope:function(默认函数级别,重要)class(重要)modulepackagesessionparams:一个可选的参数列表,它将导致对fixture函数和使用它的所有测试...原创 2019-11-28 10:38:11 · 163 阅读 · 0 评论 -
pytest标记mark的使用(三)
pytest标记使用1、参数化-pytest.mark.parametrizeimport pytestclass Test_01(object): @pytest.mark.parametrize("a,b", [(3, 6),(2,4)]) def test_a(self, a,b): print("类内部的测试a函数") print(a...原创 2019-11-28 10:38:04 · 274 阅读 · 0 评论 -
Pytest的安装和基础使用(一)
Pytest的安装和基础使用一、pytest的安装pytest 安装pip install pytest,使用5.2.1二、pytest常用的运行模式介绍test_01.pyimport pytestdef test_b(): print("测试b函数") assert 1def test_a(): print("测试a函数") asser...原创 2019-11-28 10:37:49 · 755 阅读 · 0 评论 -
pytest 用例运行级别(二)
pytest 用例运行级别1、模块级别-函数级别 模块级别在类内部无效,函数级别修饰的是类外的函数,而不是类内的方法import pytestdef setup_module(): print("我是模块级别的--start")def teardown_module(): print("我是模块级别的--end")def setup_function():...原创 2019-11-28 10:37:58 · 269 阅读 · 0 评论
分享