The "proper" way to do this is to define functional coverage for your code and then you would realise that the test was broken when you didn't hit the cover points that the test was supposed to hit.
I've never seen functional coverage used in software though - only in hardware verification. Bugs aren't costly enough to make it worth the effort.
Also... just use a better language than Python where these trivial bugs can't happen so easily.
I've never seen functional coverage used in software though - only in hardware verification. Bugs aren't costly enough to make it worth the effort.
Also... just use a better language than Python where these trivial bugs can't happen so easily.