Robert Kern <robert.k...@gmail.com> writes: > It is perfectly reasonable (and often necessary) for the unit test of > class B to use a mock object instead of a real A() instance. The unit > test for class B will fail to catch the renaming of A.foo() to A.bar() > because it never tries to call .foo() on a real A instance.
Right, which is one good reason why unit tests are *necessary* but not *sufficient*. You also need so-called “integration” tests (make sure modules work together as expected) and “system” tests (make sure the whole running system behaves as expected). This need for testing is true regardless of whether you're using a statically-typed or dynamically-typed language, of course. (I hope no-one here thinks that static typing obviates the need for integration and system tests in the test suite.) -- \ “It is far better to grasp the universe as it really is than to | `\ persist in delusion, however satisfying and reassuring.” —Carl | _o__) Sagan | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list