Last Updated: February 25, 2016
·
724
· jeffc

with and assertRaises

Checking for expected exceptions in a unit test is made much easier with, with:

with self.assertRaises(StoleniPadException):
    clown.useiPad()