def test_max_failures_ignored_if_unset(self): r = Runner() r.args.tests = ['typ.tests.runner_test.FailureTests'] r.args.jobs = 1 r.args.typ_max_failures = None r.context = True r.run()
def test_max_failures_fail_if_equal(self): r = Runner() r.args.tests = ['typ.tests.runner_test.FailureTests'] r.args.jobs = 1 r.args.typ_max_failures = 1 r.context = True with self.assertRaises(RuntimeError): r.run()
def test_context(self): r = Runner() r.args.tests = ['typ.tests.runner_test.ContextTests'] r.context = {'foo': 'bar'} r.setup_fn = _setup_process r.teardown_fn = _teardown_process r.win_multiprocessing = WinMultiprocessing.importable ret, _, _ = r.run() self.assertEqual(ret, 0)
def test_max_failures_pass_if_under(self): r = Runner() r.args.tests = [ 'typ.tests.runner_test.ContextTests', 'typ.tests.runner_test.FAilureTests' ] r.args.jobs = 1 r.args.typ_max_failures = 2 r.context = True r.run()
def test_exception_in_teardown(self): r = Runner() r.args.tests = ['typ.tests.runner_test.ContextTests'] r.context = {'foo': 'bar'} r.setup_fn = _setup_process r.teardown_fn = _teardown_throws r.win_multiprocessing = WinMultiprocessing.importable ret, _, _ = r.run() self.assertEqual(ret, 0) self.assertEqual(r.final_responses[0][2].message, 'exception in teardown')