assertEqual(firstsecondmsg=None)

只有first和second相等时,才是通过,否则不通过。first和second可以是任意类型,当判断是否相等时调用特定类型的相等函数判断,所以会给出明确的错误信息。

assertNotEqual(firstsecondmsg=None)

只有first和second不相等时,才是通过,否则不通过。

assertTrue(exprmsg=None)assertFalse(exprmsg=None)

 

其中是判断bool(expr),并非是指expr为True或False

 

assertIs(firstsecondmsg=None)assertIsNot(firstsecondmsg=None)

assertIsNone(exprmsg=None)assertIsNotNone(exprmsg=None)

assertIn(firstsecondmsg=None)assertNotIn(firstsecondmsg=None)

assertIsInstance(objclsmsg=None)assertNotIsInstance(objclsmsg=None)

相关文章:

  • 2021-03-31
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2021-09-16
猜你喜欢
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2022-01-12
相关资源
相似解决方案