断言Assertion

 

方法 检查 版本
assertEqual(a,b) a==b  
assertNotEqual(a,b) a!=b  
asserTrue(x) bool(x) is true  
asserFalse(x) bool(x) is False  
assertIs(a,b) a is b  
assertIsNot(a,b) a is not b  
assertIsNone(x) x is None  
assertIsNoneNot(x) x is not None  
assertIn(a,b) a in b  
assertInNot a not in b  
assertIsInstance(a,b) isinstance(a,b)  
assertNotIsInstance(a,b) not isinstance (a,b)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 正常断言失败则会停止测试用例运行,但是增加了异常捕获,失败了还能继续运行

使用:

selenium+python 断言Assertion

 

相关文章:

  • 2021-12-05
  • 2021-04-05
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2021-06-27
  • 2022-12-23
  • 2021-12-21
相关资源
相似解决方案