I suggest using `assertRaises` as a context manager in all these cases.