Change use of assertRaises for Python 2.6 compatibility.