[FRPythoneers] Doctest

Steve Purcell stephen_purcell at yahoo.com
Thu Jul 26 01:45:37 MDT 2001


Uche Ogbuji wrote:
> 4Suite has almost 600 test files, making up over 2000 test cases.  It is
> very rare that it can get through *all* of them without incident.  Often
> we'll have to tolerate a particular failure in a process of triage.


Hi Uche,

If I write the following test methods:

    class MyTestCase(unittest.TestCase):
        def testSomething(self):
            # might fail
        def testSomethingElse(self):
            # might also fail
        def testYetAnotherThing(self):
            # potential problems here too

then run them in the usual way wrapped up in a TestSuite (e.g. with
unittest.main()) all the test cases (ie. test methods) will be run, and 
the results reported at the end. This holds even if some of those test
cases fail.

That already sounds like the behaviour you want.

What am I missing?

(Individual test case instances, when they run their particular test
method, must work independently of any other test cases that might be run
at the same time -- this is the usual XUnit premise)


> We've been mulling over porting to PyUnit, but I fear it's a non-starter
> if it won't let us continue on failure of a test case.

Perhaps you can describe how your test code is organised into TestCase
subclasses and test methods so I can see what you mean.

Best wishes,

-Steve


-- 
Steve Purcell, Pythangelist
Get testing at http://pyunit.sourceforge.net/
Test your web apps with http://webunit.sourceforge.net/



More information about the FRPythoneers mailing list