20
20
from neutron.tests import base
26
26
def _fail_SystemExit(exc_info):
27
27
if isinstance(exc_info[1], SystemExit):
28
28
self.fail("A SystemExit was allowed out")
30
30
# add the handler last so reaching it means the handler in BaseTestCase
32
32
self.addOnException(_fail_SystemExit)
34
34
def run(self, *args, **kwargs):
35
35
exc = self.assertRaises(AssertionError,
38
38
# this message should be generated when SystemExit is raised by a test
39
39
self.assertIn('A SystemExit was raised during the test.', str(exc))