Handle assertRaises and correct name region function.