Testing code that should raise errors#

Learning Objectives#

After working through this topic, you should be able to:

  • use tests to pin down desired behaviour of your functions

  • use pytest to check that expected errors are raised

  • explain why it is important to check that tests pass for the reasons that match your mental model of the code

Materials#

Video:

Download the slides.

Quiz#