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)
def test_externalize_runs_somewhere_else(self): success = True def toggle(): global success success = False test = BasicPerfTest('', '') test._externalize(toggle) self.assertTrue(success)