code: def test_run_with_component_that_does_not_return_dict():
      BrokenComponent = component_class(
          "BrokenComponent",
          input_types={"a": int},
          output_types={"b": int},
          output=1,  # type:ignore
      )
  
      pipe = Pipeline(max_loops_allowed=10)
      pipe.add_component("comp", BrokenComponent())
      with pytest.raises(
          PipelineRuntimeError,
          match="Component 'comp' returned a value of type 'int' instead of a dict.",
      ):
          pipe.run({"comp": {"a": 1}})
  
imports: from typing import Optional
  import logging
  import pytest
  from haystack.core.pipeline import Pipeline
  from haystack.core.component.sockets import InputSocket, OutputSocket
  from haystack.core.errors import PipelineMaxLoops, PipelineError, PipelineRuntimeError
  from haystack.testing.sample_components import AddFixedValue, Threshold, Double, Sum
  from haystack.testing.factory import component_class
label_desc: Use image node_id 2 for calling a global function with example usage: test_run_with_component_that_does_not_return_dict() without return types