Comment 5 for bug 308869

Revision history for this message
James Henstridge (jamesh) wrote :

make() does not get called on every test: there is a test in the branch that shows the sequence is "make, reset, reset, ..., clean". There is a default implementation of reset() that provides the old behaviour: "call clean+make if the dirty flag is set".

The difference between dirty and needsreset is basically as follows:

_needsReset: will always be set to True when the resource is used by a test. The getResource() method will call reset() on such a resource.

_dirty: This one is controlled by the test or resource code as before. The default reset() implementation will do clean() followed by make() if this flag is set for compatibility with existing resources.

In retrospect, it might have been a bit cleaner to split this out into a subclass.