Convert assertRaises contextmanager to function call

UnitTest.assertRaises only became usable as a contextmanager in python 2.7, so
was causing failures in our 2.6 unit tests