Try to avoid just raising such a base level exception. In this case, ValueError is likely more accurate since it's the new data that's failing validation. Personally, I'd make an InvalidStateTransition exception and raise that. One of the benefits is that it makes testing more exact so that you can ensure it's the exception you wanted. Just checking for an Exception on your negative test on an invalid transition could produce an inaccurate test pass if the code is barfing on something else.