예제 #1
0
    def test_externalize_reacts_to_exceptions(self):
        """If unhandled, exceptions in externalize hang forever. Catch them."""

        def fail():

            raise Exception()

        test = BasicPerfTest('','')
        with self.assertRaises(Exception):

            test._externalize(fail)
예제 #2
0
    def test_externalize_runs_somewhere_else(self):

        success = True

        def toggle():

            global success
            success = False

        test = BasicPerfTest('', '')
        test._externalize(toggle)
        self.assertTrue(success)