Hacker News new | ask | show | jobs
by t-writescode 2475 days ago
The irony to me is that the examples he provides for things not to cover are exactly things I think should be covered. Short-circuit logic is ripe for bugs and the code that causes the short-circuit should definitely be tested!
1 comments

Yes, and exceptions. Tests must tickle all the exception paths. An exception that contains a dumb typo crashes the system instead of propagating up to get handled. Just touching the exception path roots those out.

  raise ValueError(' '.join('meaningful message with:', parameter)
Is a stupid mistake that I still make all too often inside an exception handler.