Fix handling of uncatchable exceptions.
authorRobert Collins <robertc@robertcollins.net>
Tue, 2 Sep 2014 02:16:33 +0000 (14:16 +1200)
committerRobert Collins <robertc@robertcollins.net>
Tue, 2 Sep 2014 02:57:07 +0000 (14:57 +1200)
commit18bc5741cf277f7a0d601568be6dccacc7b0783c
tree613d299a186b5a45d6843d9f7d5ed4045e0b1a62
parentb04e714e6a303d84e381c3b626ff1ec9e0857cd3
Fix handling of uncatchable exceptions.

Fix a long-standing bug where tearDown and cleanUps would not be
called if the test run was interrupted. This should fix leaking
external resources from interrupted tests.
(Robert Collins, #1364188)

Fix a long-standing bug where calling sys.exit(0) from within a test
would cause the test suite to exit with 0, without reporting a failure
of that test. We still allow the test suite to be exited (since
catching higher order exceptions requires exceptional circumstances)
but we now call a last-resort handler on the TestCase, resulting in an
error being reported for the test.
(Robert Collins, #1364188)

Change-Id: I0700f33fe7ed01416b37c21eb3f3fd0a7ea917eb
NEWS
doc/for-framework-folk.rst
testtools/deferredruntest.py
testtools/runtest.py
testtools/testcase.py
testtools/tests/test_deferredruntest.py
testtools/tests/test_runtest.py
testtools/tests/test_testcase.py