class_docstr: Test Benchmark creation
docstr: Test creation with invalid Task and Assessment
docstr_tok: ["Test","creation","with","invalid","Task","and","Assessment"]
code: def test_create_with_invalid_targets(self, benchmark_config_py):
      """Test creation with invalid Task and Assessment"""
      with OrionState() as cfg:
          with pytest.raises(AttributeError) as exc:
              config = copy.deepcopy(benchmark_config_py)
              config["targets"] = [
                  {"assess": [AverageResult(2)], "task": [DummyTask]}
              ]
              get_or_create_benchmark(cfg.storage, **config).close()
  
          assert "type object '{}' has no attribute ".format(
              "DummyTask"
          ) in str(exc.value)
  
          with pytest.raises(AttributeError) as exc:
              config = copy.deepcopy(benchmark_config_py)
              config["targets"] = [
                  {
                      "assess": [DummyAssess],
                      "task": [RosenBrock(25, dim=3)],
                  }
              ]
              get_or_create_benchmark(cfg.storage, **config).close()
  
          assert "type object '{}' has no attribute ".format(
              "DummyAssess"
          ) in str(exc.value)
  
imports: import copy
  import logging
  import pytest
  import orion.benchmark.benchmark_client
  import orion.core
  from orion.benchmark.assessment import AverageResult
  from orion.benchmark.benchmark_client import get_or_create_benchmark
  from orion.benchmark.task import CarromTable, RosenBrock
  from orion.client import ExperimentClient
  from orion.core.utils.exceptions import NoConfigurationError
  from orion.executor.joblib_backend import Joblib
  from orion.storage.base import setup_storage
  from orion.testing.state import OrionState
label_desc: Use image node_id 6 for calling the TestCreateBenchmark obj's underlying member method code with example usage: obj.test_create_with_invalid_targets(benchmark_config_py) without return types