This would normally be done with the `self.assertRaises` context manager. See the [unittest docs](http://docs.python.org/release/2.7.3/library/unittest.html#unittest.TestCase.assertRaises) for an example which makes further assertions about the exception raised.