Message 85569 - Python tracker (original) (raw)
This is actually a minor point about the order things happen in. I don't think it will cause confusion in practise once we have made a decision and documented it.
Particularly if we decide to call clean ups before tearDown then I will make adding new ones during tearDown raise an exception.
I did think about having two separate clean up stacks - one for those added during setUp and one for those added during tests, but that is starting to get silly.
The point about this patch is that it makes the deallocation of resources a lot simpler without having to manually track them inside your test (nested try finallys for this are not uncommon in the tests I've seen) and the fact that this mechanism is already in use in the test frameworks of three major projects indicate that it is definitely worthwhile.