News for hackers. Stuff that matters.
Re:Write Good Python Tests by Hackbraten on Saturday November 16, 2024 @12:20PM (#42157537)
While I agree with you on all your remaining points, one could argue that logic in tests has a non-zero risk of being flawed or buggy on its own. Worst case, a bug in the test's logic and another in the logic under test cancels each other out.

That's why I've made it a habit to write only strictly linear tests in my own code, and use fixtures and parametrization to keep duplication to a minimum.

Ultimately, there's no one true best strategy. Everything is full of trade-offs all the way down.

Re:Write Good Python Tests by satisfice on Saturday November 16, 2024 @03:27PM (#42159027)
Since I actively supervise my testing, and actively test my tests, I don’t find the prospect of mistakes in my test code to be terrifying.

I don’t understand why the possibility of difficulty with test code should cause me to write shallow, lame test code.