Assertions

The final key concept is that of assertions. Assertions are specific checks inside test methods which ultimately determine whether a test passes or fails. Among other things, assertions can:

  • Make simple boolean checks
  • Perform object equality tests
  • Verify that the proper exceptions are thrown

If an assertion fails, then a test method fails, so assertions represent the lowest level of testing you can perform. You can find a full list of assertions in the unittest documentation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset