This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author michael.foord
Recipients gregory.p.smith, michael.foord, ngie, pitrou, rbcollins
Date 2009-04-05.21:19:01
SpamBayes Score 1.380066e-09
Marked as misclassified No
Message-id <>
A use case for running clean ups before tearDown (in which case
addCleanUp would need to raise an exception if called during tearDown).

You have existing code which (for example) creates an SSH connection in
setUp and removes it in tearDown.

If clean ups are run after tearDown then you can't use addCleanup inside
tests to deallocate resources that rely on the SSH connection being
there (i.e. issue a remote command).

Switching to use clean ups would require rewriting the existing code.
Running clean ups before tearDown is more likely to fit in with existing
test code.

The downsides are that it makes adding clean ups in tearDown impossible
(but why would you want to do that?) and you can't use clean ups for any
resource accessed in tearDown (which you may want to do but won't be the
case for any code that currently exists...).

We probably need a third party arbiter to pick which is the most sane. :-)
Date User Action Args
2009-04-05 21:19:04michael.foordsetrecipients: + michael.foord, gregory.p.smith, pitrou, rbcollins, ngie
2009-04-05 21:19:04michael.foordsetmessageid: <>
2009-04-05 21:19:02michael.foordlinkissue5679 messages
2009-04-05 21:19:01michael.foordcreate