Fixed tests for python 2.6

Python 2.6 does not support the context manager version of
assertRaises.