6 ms·
I agree with almost everything in this article, except for one crucial point. The article says "And if a Python program has adequate unit tests, it can be as ro
by geophile 16y ago
I agree with almost everything in this article, except for one crucial point. The article says "And if a Python program has adequate unit tests, it can be as robust as a C++, Java or C# program with adequate unit tests."
So what is an "adequate" unit test in Python? I know some advocates of weak typing who believe that the unit tests should include tests of expected input types. 99+% of the time that's going to mean checking exactly what you'd get from static type checking. Rarely, there will be something more complex, e.g. the foobars variable can reference a FooBar object or a list containing 0 or more FooBar objects. (And then I'd question the design of the API.)
I really don't want to write those unit tests. I'd much rather have the compiler do that testing for me.