![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytest测试框架
文章平均质量分 50
pytest
山中无岁月,世上已千年
这个作者很懒,什么都没留下…
展开
-
pytest.ini配置文件
pytest.ini原创 2022-05-17 01:14:07 · 434 阅读 · 0 评论 -
pytest进阶
一、fixture特点和优势1.命令灵活:对于setup和teardown,可以不起这两个名字2.数据共享:在confest.py配置里写方法可以实现数据共享,不需要导入import导入。可以跨文件共享3.scope的层次以及神奇的yield组合相当于各种setup和teardown4.实现参数化1.1 fixture在自动化中的应用,基本用法场景:测试用例执行时,有的用例需要登录才能执行,有些用例不需要登录,setup和teardown无法满足。fixture可以。默认scop原创 2022-05-17 00:20:04 · 301 阅读 · 0 评论 -
pytest结合yaml文件实现数据驱动
pytest参数化,数据驱动,参数化原创 2022-05-13 17:32:47 · 461 阅读 · 0 评论 -
pytest初级使用
1、python断言断言的写法:assert <表达式>assert <表达式>,<描述>2.pytest测试框架结构(setup teardown)setup_module/teardown_module 全局模块级别,一个python文件为一个模块setup_class/teardown_class在类级,只在类中前后运行一次setup_function/teardown_function 函数级别,在类外,每个函数运执行前后se...原创 2022-05-13 16:53:10 · 382 阅读 · 0 评论