Since `ValueError` is what was raised before, the test isn't very discriminative. You should really catch the exception and check whether the error message (call `str` on the exception) is right.

I usually use a regex that matches the keywords in the message to make it easy to change later.