try fixing test errors in python 2.6; change calls of unittest.TestCase.assertRaises to keep backward compatibility