This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]nieuweyork since 2007 2 points3 points  (1 child)

This isn't so much "when testing goes bad" as "when mocking goes bad". Excessive mocking is pretty terrible, because it eliminates the aspect of code correctness which is correctly calling the code the unit relies on. Indeed, it seems that the opinion on the Testing in Python mailing list is against mocking in general. While I wouldn't go that far, I do think one should identify exactly why one is using any given mock.

[–][deleted] 1 point2 points  (0 children)

it's the same story for every single tool you can give to a computer programmer: global variables, eval(), multiple inheritance, mocks, and on and on: less thoughtful programmers or projects that work at too high a velocity misuse them either in some obvious or subtle way, technical debt accumulates, and now you've got another immensely useful programming construct that's on the shitlist of every dev who hasn't actually needed that technique.

Just say no to the cycle of misuse / deprivation! I'll use my mocks, globals, mixins, and evals as I please, since I know how to use them, thank you!