I am trying to figure out difference between SetupSuite
and SetupTest
for quite some time now. Based on information on blogs I have understood that SetupSuite
is run before entire suite and SetupTest
runs before each test case. But what could be practical example in such a case? And how does dependency injection differ in both the cases?
Testify Suite中SetupSuite和SetupTest之间的区别
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- douyaosi3164 2018-06-25 21:35关注
Generally you want to use
SetupTest
so that each individual test function runs with a clean environment.SetupSuite
is useful in cases where the setup code is time consuming and isn't modified in any of the tests. An example of when this could be useful is if you were testing code that reads from a database, and all the tests used the same data and only ranSELECT
statements. In this scenario,SetupSuite
could be used once to load the database with data.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 求差集那个函数有问题,有无佬可以解决
- ¥15 【提问】基于Invest的水源涵养
- ¥20 微信网友居然可以通过vx号找到我绑的手机号
- ¥15 寻一个支付宝扫码远程授权登录的软件助手app
- ¥15 解riccati方程组
- ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
- ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
- ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
- ¥50 树莓派安卓APK系统签名
- ¥65 汇编语言除法溢出问题