Roy Smith <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > > Test cases should each run individually, from a known state, and > > not depend on any other tests. You can define a fixture for > > several tests in the unittest.TestCase methods setUp() and > > tearDown(), to establish and clear up respectively for each test. > > In general, I certainly agree with the above. The problem is that > sometimes setup is so expensive, it becomes impractical to do a full > setup/teardown cycle for each test.
That's what mock objects are for. The test fixture should be minimal, having only the interface needed to test that the production code does what it should, with almost no functionality behind that interface. <URL:http://pmock.sourceforge.net/> -- \ "I always had a repulsive need to be something more than | `\ human." -- David Bowie | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list