def test_externalize_reacts_to_exceptions(self): """If unhandled, exceptions in externalize hang forever. Catch them.""" def fail(): raise ValueError() test = BasicProfile('', '') with self.assertRaises(ValueError): test._externalize(fail)
def test_externalize_reacts_to_exceptions(self): """If unhandled, exceptions in externalize hang forever. Catch them.""" def fail(): raise ValueError() test = BasicProfile('','') with self.assertRaises(ValueError): test._externalize(fail)
def test_externalize_runs_somewhere_else(self): success = True def toggle(): # This will only affect the success variable above if the code # is executed in the same Python process as the test. global success success = False test = BasicProfile('', '') test._externalize(toggle) self.assertTrue(success)
def test_externalize_runs_somewhere_else(self): success = True def toggle(): # This will only affect the success variable above if the code # is executed in the same Python process as the test. global success success = False test = BasicProfile('', '') test._externalize(toggle) self.assertTrue(success)