![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytest allure
文章平均质量分 86
LI~友
这个作者很懒,什么都没留下…
展开
-
Pytest的常用插件(五)
Pytest插件 pytest插件列表:https://plugincompat.herokuapp.com Pytest测试报告(pytest-html) 安装:pip3 install pytest-html 命令行格式:pytest --html=用户路径/report.html 配置文件:addopts = -s --html=./report.html Pytest执行顺序 安装: pi...原创 2019-11-28 10:38:17 · 257 阅读 · 0 评论 -
pytest的fixture的使用(四)
pytest的fixture的使用 1、@fixture(scope=‘function’, params=None, autouse=False, ids=None, name=None) scope: function(默认函数级别,重要) class(重要) module package session params:一个可选的参数列表,它将导致对fixture函数和使用它的所有测试...原创 2019-11-28 10:38:11 · 78 阅读 · 0 评论 -
pytest标记mark的使用(三)
pytest标记使用 1、参数化-pytest.mark.parametrize import pytest class 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 · 177 阅读 · 0 评论 -
Pytest的安装和基础使用(一)
Pytest的安装和基础使用 一、pytest的安装 pytest 安装pip install pytest,使用5.2.1 二、pytest常用的运行模式介绍 test_01.py import pytest def test_b(): print("测试b函数") assert 1 def test_a(): print("测试a函数") asser...原创 2019-11-28 10:37:49 · 654 阅读 · 0 评论 -
pytest 用例运行级别(二)
pytest 用例运行级别 1、模块级别-函数级别 模块级别在类内部无效,函数级别修饰的是类外的函数,而不是类内的方法 import pytest def setup_module(): print("我是模块级别的--start") def teardown_module(): print("我是模块级别的--end") def setup_function():...原创 2019-11-28 10:37:58 · 197 阅读 · 0 评论