zoukankan      html  css  js  c++  java
  • python unittest学习7---第二类方法,assert相关方法

    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)

  • 相关阅读:
    第二周c语言PTA作业留
    2018第零次作业
    总结报告
    第14/15周作业
    第七周作业
    第六周作业
    第四次作业
    第三次作业
    大学第二次作业
    大学的第一次作业
  • 原文地址:https://www.cnblogs.com/dmtz/p/10974293.html
Copyright © 2011-2022 走看看