Remove use of .assertRaisesRegexp to be compatible with Python 2.6.