Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:

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.

----------
keywords: +patch
Added file: http://bugs.python.org/file26405/issue-15351-concept.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15351>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to