python+selenium+unittest----skip(跳过用例)

 一个人学习不如和大家一起学习,群里有学习资料,欢迎你加入软件测试交流群,群号:1062843742

我们在执行测试用例时,有时有些用例时不需要执行的,这时就需要用到unittest给我们提供的跳过用例的方法

@unittest.skip(reason):强制跳过,不需要判断条件。reason是跳过原因的描述必须填写。

@unittest.skipIf(condition, reason):condition为True跳过用例

 @unittest.skipUnless(condition, reason):当condition为False跳过用例

 @unittest.expectedFailure:如果test失败了,这个test不计入失败的case数目

原文地址:https://www.cnblogs.com/humiao-0626/p/11898887.html