def test__run_core_called(self): case = self.make_case() log = [] run = RunTest(case, lambda x: x) run._run_core = lambda: log.append('foo') run.run() self.assertEqual(['foo'], log)
def test__run_prepared_result_calls_stop_test_always(self): result = ExtendedTestResult() case = self.make_case() def inner(): raise Exception("foo") run = RunTest(case, lambda x: x) run._run_core = inner self.assertRaises(Exception, run.run, result) self.assertEqual([ ('startTest', case), ('stopTest', case), ], result._events)