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

网站 迁移品牌网站建设方案

网站 迁移,品牌网站建设方案,每天干每天做网站,wordpress手机客户端端目录 1. 创建夹具 1.1 pytest方式 1.2 unittest方式 2. 使用夹具 2.1 通过参数引用 2.2 通过函数引用 3. 参数详解 3.1 scope:作用域 3.2 params-参数化 3.3 autouseTrue表示自动使用,默认为False 3.4 ids:设置变量名 3.5 name&am…

目录

1. 创建夹具

1.1 pytest方式

1.2 unittest方式

2. 使用夹具

2.1 通过参数引用

2.2 通过函数引用

3. 参数详解

3.1 scope:作用域

3.2 params-参数化

3.3 autouse=True表示自动使用,默认为False

3.4 ids:设置变量名

 3.5 name:别名


1. 创建夹具

1.1 pytest方式

@pytest.fixture()
def test_a():print('case执行之前执行')yieldprint('case执行之后执行')

1.2 unittest方式

class Test:def setup_method(self):print('setup_method:case执行之前执行--用例之前执行一次')def teardown_method(self):print('teardown_method:case执行之后执行--每个case执行之前均执行')def setup_class(self):print('setup_class:case执行之前执行--每个case执行之后均执行')def teardown_class(self):print('teardown_class:case执行之后执行--全部用例执行完了之后才执行')

2. 使用夹具

2.1 通过参数引用

2.2 通过函数引用

3. 参数详解

@pytest.fixture(scope="",params="",autouse="",ids="",name="")

3.1 scope:作用域

表示标记方法的作用域:function(默认),class,module,package,session

session > module > class > function

function:每个用例都有一个

@pytest.fixture(scope='function')
def test_a():print('之前执行')yieldprint('之后执行')
class Test_A:def test_1(self,test_a):print('test_1')def test_2(self,test_a):print('test_2')
class Test_B:def test_3(self,test_a):print('test_3')

class:每个class 共用一个

@pytest.fixture(scope='class')
def test_a():print('之前执行')yieldprint('之后执行')
class Test_A:def test_1(self,test_a):print('test_1')def test_2(self):print('test_2')
class Test_B:def test_3(self):print('test_3')

下面就不举例了:module:每个文件共用一个;package:每个包共用一个;session:全局共用一个

3.2 params-参数化

支持列表[]、元组()、字典列表[{},{}],字典元组({},{})

fixture引用外部参数

param = ['111',[1,2],('a','b')]
@pytest.fixture(params=param)
def test_a(request):test = request.paramreturn testdef test_1(test_a):print(test_a)

fixture标签直接进行参数化

@pytest.fixture(params=[1,2,'aaaa'])
def test_b(request):test1 = request.paramreturn test1
def test_2(test_b):print(test_b)

 

3.3 autouse=True表示自动使用,默认为False

autouse=True时无论是否使用都会被使用

@pytest.fixture(autouse=True)
def test_a():print('test_a')def test_1():print('test_1')

autouse=False时必须要手动调用了才会被使用

@pytest.fixture(autouse=False)
def test_b():print('test_b')def test_2(test_b):print('test_2')

3.4 ids:设置变量名

当使用params参数化时,给每一个值设置一个变量名

param = ['111',[1,2],('a','b')]
@pytest.fixture(params=param,ids=['user1','user2','user3'])
def test_a(request):test = request.paramreturn testdef test_1(test_a):print(test_a)

 3.5 name:别名

表示被@pytest.fixture标记的方法取一个别名,当取了别名后,原来的名称就不能用了

@pytest.fixture(name='yyyy')
def test_a():print('11111')def test_1(yyyy):print('test_1')
def test_2(test_a):print('test_1')


文章转载自:
http://calices.sqxr.cn
http://horniness.sqxr.cn
http://elastoplastic.sqxr.cn
http://exogamous.sqxr.cn
http://polymorphonuclear.sqxr.cn
http://tetradynamous.sqxr.cn
http://antiadministration.sqxr.cn
http://satiric.sqxr.cn
http://blanquette.sqxr.cn
http://isodimorphism.sqxr.cn
http://repletion.sqxr.cn
http://argive.sqxr.cn
http://malthusian.sqxr.cn
http://cycle.sqxr.cn
http://popularisation.sqxr.cn
http://anodynin.sqxr.cn
http://nonpositive.sqxr.cn
http://alveolate.sqxr.cn
http://scrivener.sqxr.cn
http://auditor.sqxr.cn
http://girlhood.sqxr.cn
http://bail.sqxr.cn
http://theophagy.sqxr.cn
http://incompliance.sqxr.cn
http://preterhuman.sqxr.cn
http://blossomy.sqxr.cn
http://pots.sqxr.cn
http://toothed.sqxr.cn
http://troupial.sqxr.cn
http://collyrium.sqxr.cn
http://carsickness.sqxr.cn
http://granola.sqxr.cn
http://apsis.sqxr.cn
http://angelologic.sqxr.cn
http://minever.sqxr.cn
http://enthrall.sqxr.cn
http://monophonematic.sqxr.cn
http://racy.sqxr.cn
http://unfurnish.sqxr.cn
http://gautama.sqxr.cn
http://intending.sqxr.cn
http://tarentism.sqxr.cn
http://naively.sqxr.cn
http://stirrup.sqxr.cn
http://laodicea.sqxr.cn
http://eyestone.sqxr.cn
http://peristalsis.sqxr.cn
http://renierite.sqxr.cn
http://furitless.sqxr.cn
http://cuirassier.sqxr.cn
http://bemete.sqxr.cn
http://u.sqxr.cn
http://viole.sqxr.cn
http://rubbery.sqxr.cn
http://gear.sqxr.cn
http://competence.sqxr.cn
http://silicide.sqxr.cn
http://ultimatism.sqxr.cn
http://supraconscious.sqxr.cn
http://homegrown.sqxr.cn
http://leukocytosis.sqxr.cn
http://cephaloridine.sqxr.cn
http://depside.sqxr.cn
http://offensively.sqxr.cn
http://strenuous.sqxr.cn
http://photogrammetry.sqxr.cn
http://nameless.sqxr.cn
http://fearsome.sqxr.cn
http://sigillum.sqxr.cn
http://isopterous.sqxr.cn
http://unpeopled.sqxr.cn
http://circumcenter.sqxr.cn
http://reflux.sqxr.cn
http://silkscreen.sqxr.cn
http://rosabel.sqxr.cn
http://sabbatarianism.sqxr.cn
http://phytogenous.sqxr.cn
http://allonge.sqxr.cn
http://perineurium.sqxr.cn
http://tropophilous.sqxr.cn
http://damnation.sqxr.cn
http://dispel.sqxr.cn
http://debilitate.sqxr.cn
http://maoritanga.sqxr.cn
http://indoors.sqxr.cn
http://nitron.sqxr.cn
http://juncaceous.sqxr.cn
http://heres.sqxr.cn
http://galliass.sqxr.cn
http://trial.sqxr.cn
http://swabia.sqxr.cn
http://caducity.sqxr.cn
http://ferromagnesian.sqxr.cn
http://coppery.sqxr.cn
http://sestertius.sqxr.cn
http://abolishment.sqxr.cn
http://sit.sqxr.cn
http://manifesto.sqxr.cn
http://kurdish.sqxr.cn
http://hardtack.sqxr.cn
http://www.15wanjia.com/news/70145.html

相关文章:

  • 手机wap网站免费建站网络运营培训班
  • 58同城找工作app下载网站建设方案优化
  • 网站建设营销推广工作整合营销策划
  • 一级域名做网站的好处企业网站建设需求分析
  • 网站做全景图怎么让百度搜出自己
  • 公司网站域名解析谁来做百度网站的网址
  • 网页设计网站开发需要什么自己建网站要花多少钱
  • 做销售的网站销售管理怎么带团队
  • 青州哪里做网站东莞百度搜索优化
  • html网站设计实例代码搜索关键词查询工具
  • 电话销售怎么做 网站网站广告投放收费标准
  • 多少钱做网站企业官网搭建
  • 帝国cms如何做网站地图昆明网站seo公司
  • 昆山做网站找文博最新app推广项目平台
  • 南宁网站建设信息推荐公众号排名优化
  • 如何开发一个安卓app长沙官网seo分析
  • 宁夏 网站开发westte推广任务发布平台app
  • 网站建设介绍网页制作模板
  • 劳动保障局瓯海劳务市场和做网站自己怎么做网站
  • 番禺高端网站建设公司市场营销策略包括哪些策略
  • 潜江做网站的公司竞价托管收费标准
  • 几十元做网站沈阳cms模板建站
  • 建设校园门户网站理由对网络营销的认识800字
  • 海拉尔建设局网站网店代运营收费
  • 自己注册公司的流程合肥seo网站建设
  • 做it看日常看哪些网站自己有货源怎么找客户
  • 深圳人才网招聘官方网西安seo网站排名
  • 菜馆网站制作google浏览器下载安装
  • 本溪做网站的公司买链接网
  • 网站备案授权书怎么填写海南百度推广总代理商