
pytest
文章平均质量分 82
weixin_46583017
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
pytest-fixture
pytest-fixture一、适用范围1.替代setup和teardown2.参数化如何使用:1.给要使用的方法传入fixture的函数名2.使用装饰器@pytest.mark.usefixtures(’’)3.可以使用多个fixture4.作用域:session>module>class>function二、替代setup和teardown替代setup给要使用的方法传入fixture的函数名使用装饰器@pytest.mark.usefixtures(’’)i原创 2021-01-02 16:39:18 · 346 阅读 · 2 评论 -
allure安装和使用(feature,链接,图片,html)
allure安装和使用一、allure安装二、allure使用生成报告1.pytest -sq ***.py --alluredir=./result/12.pytest serve ./result/1生成一次性报告3.pytest generate ./result/1 -o ./report/1生成并保存报告4.allure open -h 192.168.1.104 -p 3772 ./report/12.常用特性2.1添加功能信息,子功能信息,测试步骤加--allure-feature或者--al原创 2021-01-02 14:47:10 · 1705 阅读 · 1 评论 -
yaml+pytesth中parametrize参数化如何引入参数
yaml+pytesth中parametrize参数化yaml数据文件待测试代码块yaml+pytesth中parametrize测试方法一:打开yaml文件和测试代码写在一起方法二:把打开yaml文件单独写在一个py中1.ya_try.py2.读入数据yaml数据文件testdata.yamladd:[0,1,1][-1,0,-1][-1,1,0][-9.4536,-9.55,-19.0036]addids:Positivenegativeintdecimalsub:[-1,原创 2020-12-30 11:15:19 · 1608 阅读 · 0 评论 -
pytest-----setup和teardown的作用域
pytest-----setup和teardown的作用域setup和teardown的作用域代码结果优先级setup和teardown的作用域代码#本段代码目的是说清楚setup和teardown的作用域def test_case1(): print("这是一个函数测试用例1")def test_case2(): print("这是一个函数测试用例2")#setup_function和teardown_functiondef setup_function(self):原创 2020-12-29 11:48:17 · 483 阅读 · 0 评论