Did I find the right examples for you? yes no

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)
Add a handler to be called when an exception occurs in test code.

This handler cannot affect what result methods are called, and is
called before any outcome is called on the result object. An example
use for it is to add some diagnostic state to the test details dict
which is expensive to calculate and not interesting for reporting in
the success case.

Handlers are called before the outcome (such as addFailure) that
the exception has caused.(more...)

src/s/s/sst-0.2.4/src/sst/cases.py   sst(Download)
        self.addCleanup(self.stop_browser)
        if self.screenshots_on:
            self.addOnException(self.take_screenshot_and_page_dump)
        if self.debug_post_mortem:
            self.addOnException(
                self.print_exception_and_enter_post_mortem)
        if self.extended_report:
            self.addOnException(self.report_extensively)

src/t/e/testtools-0.9.35/testtools/tests/test_testcase.py   testtools(Download)
            def method(self):
                self.addOnException(events.append)
                self.onException(an_exc_info)
        case = Case("method")
        case.run()
            def method(self):
                self.addOnException(events.index)
                self.assertThat(lambda: self.onException(an_exc_info),
                    Raises(MatchesException(ValueError)))
        case = Case("method")

src/t/e/testtools-HEAD/testtools/tests/test_testcase.py   testtools(Download)
            def method(self):
                self.addOnException(events.append)
                self.onException(an_exc_info)
        case = Case("method")
        case.run()
            def method(self):
                self.addOnException(events.index)
                self.assertThat(lambda: self.onException(an_exc_info),
                    Raises(MatchesException(ValueError)))
        case = Case("method")

src/n/e/neutron-HEAD/neutron/tests/base.py   neutron(Download)
        # Configure this first to ensure pm debugging support for setUp()
        if os.environ.get('OS_POST_MORTEM_DEBUG') in TRUE_STRING:
            self.addOnException(post_mortem_debug.exception_handler)
 
        if os.environ.get('OS_DEBUG') in TRUE_STRING: