Comment 8 for bug 308869

Revision history for this message
Robert Collins (lifeless) wrote :

I've linked a follow on branch from yours that doesn't implement needsReset which I am still struggling with. It does however make reset() a public method.

The needsReset method I don't like because it doesn't feel different enough to dirtied(), and looks liable to misbehave. Specifically it seemed identical to it with the sole exception that ResourcedTestCase was going to call it, and having to call a function to make sure reset happens, while no different to dirtied(), means that there are two methods resource instances, or clients, need to call to make sure things work properly. I'd like to keep that problematic part of the interface as small as possible.

What I'm considering instead is to have an optional parameter to getResource which OptimisingTestResource could pass in, which allows a 'faster to reset than check' resource to:
 - override isDirty() as lamba: True
 - define reset()

and have reset called between test cases, and not otherwise.