Alternative test for assertRaisesRegexp for Python 2.6