def test_runner_function_should_be_wrapped(self): def runner_function(es, params): pass runner.register_runner(operation_type="unit_test", runner=runner_function) returned_runner = runner.runner_for("unit_test") self.assertIsInstance(returned_runner, runner.DelegatingRunner) self.assertEqual("user-defined runner for [runner_function]", repr(returned_runner))
def test_runner_class_should_be_wrapped(self): class UnitTestRunner: def __call__(self, *args): pass def __str__(self): return "UnitTestRunner" test_runner = UnitTestRunner() runner.register_runner(operation_type="unit_test", runner=test_runner) returned_runner = runner.runner_for("unit_test") self.assertIsInstance(returned_runner, runner.DelegatingRunner) self.assertEqual("user-defined runner for [UnitTestRunner]", repr(returned_runner))
def test_runner_class_with_context_manager_should_be_registered_as_is(self): class UnitTestRunner: def __enter__(self): return self def __call__(self, *args): pass def __exit__(self, exc_type, exc_val, exc_tb): return False test_runner = UnitTestRunner() runner.register_runner(operation_type="unit_test", runner=test_runner) returned_runner = runner.runner_for("unit_test") self.assertTrue(test_runner == returned_runner)
def setUp(self): runner.register_default_runners() self.runner_with_progress = ExecutorTests.RunnerWithProgress() runner.register_runner("unit-test-recovery", self.runner_with_progress)
def setUp(self): self.test_track = track.Track(name="unittest") self.runner_with_progress = SchedulerTests.RunnerWithProgress() params.register_param_source_for_name("driver-test-param-source", DriverTestParamSource) runner.register_default_runners() runner.register_runner("driver-test-runner-with-completion", self.runner_with_progress)