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_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_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')
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')