pytest
LiaoBin0608
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
pytest学习笔记4
1、allure安装安装pytestpip install pytest安装allure-pytestpip install allure-pytest2、下载allure命令行工具1、去github上下载最新版https://github.com/allure-framework/allure2/releases2、下载完成后,解压本地,并匹配环境变量(最好放在path的第一位)3、allure执行与生成报告执行命令pytest [py文件] -q -s --al原创 2020-06-11 15:12:43 · 212 阅读 · 0 评论 -
pytest学习笔记3
1、函数传参数当前置用例函数需要传参import pytesttest_login_data = [("admin","admin"),("user","123456")]def login(user, pwd): print(f"登录用户名:{user}") print(f"登录密码:{pwd}") if pwd == "admin": return True else: return False @pytest原创 2020-06-11 00:02:23 · 239 阅读 · 0 评论 -
pytest学习笔记2
1、pycharm设置pytest1、选择File-setting,搜索框中搜索pytest,2、可以看到Tools-Python IntegratedTools,有个Testing选项下Default test runner,选择pytest,点击Apply,点击OK2、pycharm运行pytest1、直接右击空白处,点击‘Run ‘pytest in *’’2、运行单个类或者方法,点击左侧的绿色三角箭头3、pytest fixture的用法fixture 用法Fixtu原创 2020-06-10 17:58:19 · 441 阅读 · 0 评论 -
pytest学习笔记1
1、安装pytestpip install -U pytest2、查看pytest版本pytest --version 或 pytest -V3、pytest用例设计原则1、测试文件以test开头(或者以_test结尾)2、测试类以Test开头,并且不能带init方法3、测试函数以test_开头def add(x, y): return x + ydef test_add(): assert add(1, 10) == 11 assert add(1,原创 2020-06-10 18:02:48 · 222 阅读 · 0 评论
分享