[Pyunit-interest] Newbie confused by options
Brought to you by:
purcell
From: Noah <no...@no...> - 2002-08-02 20:59:40
|
In what circumstance would I want to define runTest() vs. testXXX()? I am unclear on the difference between the runTest() method and test methods in the form testXXX() (where XXX is replaced by some string). The PyUnit Website starts by introducing runTest(), but then almost immediately switches to the form testXXX() for tests. The TestCase doc string says "test code itself should be placed in a method named 'runTest'", yet I was able to follow all the examples on the PyUnit Website while ignoring runTest(). It seems that runTest() is redundant since the TestSuite class will automatically discover methods named in the form testXXX(). In fact runTest() seems to be limited in functionality because you cannot use unittest.main() to test a class that only overrides runTest(). And unittest.TestSuite().makeSuite() likewise does not use runTest(). Is there more than one way to do it? Yours, Noah |