Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pytest expected exception

  • What if raising an exception is part of the specification of a function?
  • That given certain (incorrect) input it will raise a certain exception?
  • How can we test that we get the right exception. The expected exception?