changed all assertRaises in tests to use the with statement