pytest学习笔记一,setup和teardown

用例运行级别

模块级(setup_module/teardown_module)开始与模块始末,全局的

函数级(setup_function/teardown_function)只对函数用例生效(不在类中)

类级(setup_class/teardown_class)只在类中前后运行一次(在类中)

方法级(setup_methon/teardown_methon)开始与方法始末(在类中)

类里面的(setup/teardown)运行在调用方法前后

猜你喜欢

转载自www.cnblogs.com/yronl/p/12958153.html
今日推荐