#programming #linters #testing #test_coverage #bad_programming_habits
An observation about writing tests in weakly typed languages like Python.
You should DISABLE some linting features when writing tests. Not everywhere and not all of them. But where needed.
Lint being fully enabled for writing tests can guide you to fragile code and poor tests without realizing it because you may avoid writing tests that the linter complains about without thinking about WHY it's a lint issue and not a compiler error.
Linters catch problems that DO NOT violate the compiler's rules. Such as passing a wrongly typed value in a weakly typed language.
That is WHY they're lint issues rather than compiler errors: The compiler DOES NOT CARE if you do a bad thing that a linter complains about.
100% test coverage only proves you CAN execute all the code without generating unexpected results, not that it WILL always do the right thing for unexpected inputs and situations.
It only proves code functionality, NOT code correctness.