![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytest框架
Wake__Up_
这个作者很懒,什么都没留下…
展开
-
pytest框架——fixture固件1
使用场景距离:3条用例,其中两条需要执行登录操作,另外一条用例不需要进行登录操作,我们就可以使用fixture来使问题简单化 ex: `# -- coding:utf-8 -- #auth:duoduo import pytest @pytest.fixture() def login(): print(“登录成功”) def test_1(login): #需要登录 assert 11 def test_2(): #不需要登录 assert 22 def test_3(login): #需要登录 ass原创 2021-04-16 10:50:58 · 190 阅读 · 0 评论 -
pytest_安装与配置
安装 用pip install -U pytest 命令进行安装 -U 的意思是 如果现在有安装就升级最新版本,如果没有安装就安装最新版本 pycharm中配置pytest pytest默认使用xxx.py的模式去运行脚本的,想默认以pytest模式运行,得在pycharm中做如下配置 测试是否配置完成 # -*- coding:utf-8 -*- #auth:duoduo import pytest def setup_function(): print("开始执行") def teard原创 2021-04-09 10:03:15 · 215 阅读 · 0 评论