当前位置: 首页 > news >正文

免费网站建设空间wordpress系统迁移

免费网站建设空间,wordpress系统迁移,网络营销和网络销售的区别,进入秦皇岛最新规定1.安装 pip install pytestpytest官网#xff1a;https://docs.pytest.org/en/stable/ 2.编写规则 1.测试文件已test开头#xff08;或以test结尾#xff09; 2.测试类以Test开头#xff0c;并且不能带有init方法 3.测试函数以test开头 4.断言使用基本的assert即可 3.p…1.安装 pip install pytestpytest官网https://docs.pytest.org/en/stable/ 2.编写规则 1.测试文件已test开头或以test结尾 2.测试类以Test开头并且不能带有init方法 3.测试函数以test开头 4.断言使用基本的assert即可 3.pytest使用 1.运行 需要在pycharm设置界面配置 用绿色执行箭头 用main 方法执行 if __name__ __main__:pytest.main([demo3.py])用命令行 # 1.执行xxx.py文件里面的所有方法 pytest -v -s xxx.py # 2.执行xxx.py文件里面指定的方法test_func1 pytest xxx.py::test_func1 pytest -k func1 xxxx.py # 使用模糊匹配使用-k选项标识使用pytest.mark在函数上进行标记 首先写个配置文件pytest.ini 在测试用例注释执行或不执行 import pytestclass TestLoginCase(object):pytest.mark.dodef test01(self):print(这是第一条测试用例)pytest.mark.undodef test02(self):print(这是第二条测试用例)# 命令执行xxx.py文件里标准执行的测试用例 pytest -m do xxx.py2.pytest参数化 pytest.mark.parametrize(argnames,argvalues) argvalues可以是列表元组字典 # 列表 data [123, 456]pytest.mark.parametrize(pwd, data) def test1(pwd):print(pwd) # 元组 data1 [(admin, 123, mbzx), (amdin, 456, m24x)]pytest.mark.parametrize(username, password, vector, data1) def test2(username, password, vector):print(username, password, vector)# 字典 data2 ({user: 1,pwd: 2},{age: 3,email: fgqq.com} )pytest.mark.parametrize(dic, data2) def test3(dic):print(dic) data3 [pytest.param(1, 2, 3, id(ab):pass), # id的值可以自定义只要方便理解每个用例是干什么的即可pytest.param(4, 5, 10, id(ab):fail) ]def add(a, b):return a bpytest.mark.parametrize(a,b,expect, data3) def test04(a, b, expect):assert add(a, b) expect3.pytest.fixture 1.定义fixture跟定义普通函数差不多唯一区别就是在函数上加个装饰器pytest.fixture 2.fixture命名不要以test开头跟用例区分开。fixture是有返回值没有返回值默认为None。 3.用例调用fixture的返回值直接就是把fixture的函数名称当做变量名称。 pytest.fixture() def demo():print(这是一个例子)return 1 def test05(demo):print(这是一个测试)4.setup和teardown 1.模块级setup_module/teardown_module开始于模块始末全局的 2.函数级setup_function/teardown_fuction只对函数用例生效不在类中 import pytestdef setup_module():print(setup_module)def teardown_module():print(teardown_module)def setup_function():print(setup_function)def teardown_function():print(teardown_function)def test1():print(test1)def test2():print(test2)3.类级setup_class/teardown_class只在类中前后运行一次在类中 4.方法级setup_method/teardown_method开始于方法始末在类中 5.类里面的setup/teardown运行在调用方法的前后 import pytestclass TestCase01(object):classmethoddef setup_class(cls):print(setup_class)classmethoddef teardown_class(cls):print(teardown_class)classmethoddef setup_method(cls):print(setup_method)classmethoddef teardown_method(cls):print(teardown_method)classmethoddef setup(cls):print(setup)classmethoddef taerdown(cls):print(teardown)def test1(self):print(test1)def test2(self):print(test2)def test3(self):print(test3)4.生成测试报告 1.安装 pip install allure-pytest2.官方文档https://docs.qameta.io/ 3.下载allure 地址https://dl.bintray.com/qameta/generic/io/qameta/allure/2.7.0/
http://www.pierceye.com/news/742881/

相关文章:

  • 佛山网站设计多少钱兴国做网站
  • 自己可以做网站生意好做吗手机制作音乐的软件app
  • 国土政务网站建设制度下载购物app
  • 阿里云一键建站网站网站前端浏览器兼容如何做
  • 如何看一个网站的备案在哪里做的多媒体资源库网站建设
  • 店铺推广软件广州推广优化
  • 做读书笔记的网站wordpress主题miku
  • 淘掌门官方网站wordpress注册验证邮箱验证
  • 牡丹江市建设局网站网站功能项目报价
  • 网站系统管理网站制作报价ihanshi
  • 陈村网站开发网站应该如何进行优化
  • 做网站什么语言最好电商有哪些平台app
  • 做号网站做旅游网站运营
  • 陕西省西安市网站建设公司都江堰网站建设
  • 怎么做网站xml地图导航条 Wordpress
  • 网站建设合同或方案书网站备案多长时间
  • 广州学生做网站山东德州网站建设哪家最专业
  • 类似pc蛋蛋的网站建设建设官方网站意义
  • 公积金门户网站建设方案阿里国际站韩语网站怎么做
  • 粉色大气妇科医院网站源码软件系统app开发
  • 跨境自建站模板建设个公司网站需要多少费用
  • 帮客户做ppt什么的在哪个网站泰安做网站多少钱
  • 如何查网站空间游戏网站开发找什么人可建
  • 网站备案图标怎么添加为农村建设网站报告
  • 网站建设公司成都北京有哪些炫酷的网站页面
  • 中医医院网站建设需求网络优化这个行业怎么样
  • 做兼职网站的主要参考文献洪栾单页网站建设
  • 市中移动网站建设辽宁招标网
  • wordpress+纯净主题国外seo工具
  • 网站备案 深圳wap免费空间