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 chris.jerdonek
Recipients chris.jerdonek, michael.foord, r.david.murray
Date 2012-07-16.20:53:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1342472006.05.0.466323169441.issue15351@psf.upfronthosting.co.za>
In-reply-to
Content
Attached is a patch illustrating the API I suggested for discussion.

To add custom setup and teardown context managers, the user can override the following method:

    def executeTest(self):
        with self.setUpContext():
            self.runTestMethod()

The custom context managers can be placed either before or after the existing setUp/tearDown, or both.

The patch preserves the existing behavior that tearDown() should run only if setUp() was successful, and that doCleanups() should always run.  All tests continue to pass with the patch.
History
Date User Action Args
2012-07-16 20:53:26chris.jerdoneksetrecipients: + chris.jerdonek, r.david.murray, michael.foord
2012-07-16 20:53:26chris.jerdoneksetmessageid: <1342472006.05.0.466323169441.issue15351@psf.upfronthosting.co.za>
2012-07-16 20:53:25chris.jerdoneklinkissue15351 messages
2012-07-16 20:53:25chris.jerdonekcreate