摘要: 1.首先需要pycharm需要安装ini插件 2.在项目的最外层创建 pytest.ini 文件(名字必须一样),标签距离左边一个tab键 [pytest] markers = test_addCustomer: 创建直客商户 #标注可以不写 test_login: 登录接口 3.给接口进行打标签 阅读全文
posted @ 2020-11-03 17:43 西西cc 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 作用:进行环境的设置与清除。我就是把清楚allure报告放在开始的位置,会根据fixtrue控制级别来执行 import pytest import os @pytest.fixture(scope='module',autouse=True) def start_demo(request): pr 阅读全文
posted @ 2020-11-03 16:30 西西cc 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 搭建环境 自动打开报告: #--alluredir = ../../report/apiReport/tep --生成allure报告需要的数据源pytest.main(['test_addCustomer.py','-s','--alluredir','../../report/apiReport 阅读全文
posted @ 2020-11-03 16:27 西西cc 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 注意点:******************(pytest fixture不能夸py文件使用) 传参的时候必须要写request,底下引用要使用request.param 下面调用时候需要这样写:@pytest.mark.parametrize("test_send_code",datas,indi 阅读全文
posted @ 2020-11-03 11:25 西西cc 阅读(427) 评论(0) 推荐(0) 编辑