code: def test_cbva002_callback_return_validation():
      app = Dash(__name__)
      app.layout = html.Div(
          [
              html.Div(id="a"),
              html.Div(id="b"),
              html.Div(id="c"),
              html.Div(id="d"),
              html.Div(id="e"),
              html.Div(id="f"),
          ]
      )
  
      @app.callback(Output("b", "children"), [Input("a", "children")])
      def single(a):
          return set([1])
  
      single_wrapped = app.callback_map["b.children"]["callback"]
  
      with pytest.raises(InvalidCallbackReturnValue):
          # outputs_list (normally callback_context.outputs_list) is provided
          # by the dispatcher from the request.
          single_wrapped(
              "aaa", outputs_list={"id": "b", "property": "children"}
          )
          pytest.fail("not serializable")
  
      @app.callback(
          [Output("c", "children"), Output("d", "children")],
          [Input("a", "children")],
      )
      def multi(a):
          return [1, set([2])]
  
      multi_wrapped = app.callback_map["..c.children...d.children.."][
          "callback"
      ]
  
      with pytest.raises(InvalidCallbackReturnValue):
          outputs_list = [
              {"id": "c", "property": "children"},
              {"id": "d", "property": "children"},
          ]
          multi_wrapped("aaa", outputs_list=outputs_list)
          pytest.fail("nested non-serializable")
  
      @app.callback(
          [Output("e", "children"), Output("f", "children")],
          [Input("a", "children")],
      )
      def multi2(a):
          return ["abc"]
  
      multi2_wrapped = app.callback_map["..e.children...f.children.."][
          "callback"
      ]
  
      with pytest.raises(InvalidCallbackReturnValue):
          outputs_list = [
              {"id": "e", "property": "children"},
              {"id": "f", "property": "children"},
          ]
          multi2_wrapped("aaa", outputs_list=outputs_list)
          pytest.fail("wrong-length list")
  
file_path: dash/tests/integration/callbacks/test_validation.py
imports: import pytest
  from dash import Dash, Input, Output, State, html
  from dash.exceptions import InvalidCallbackReturnValue, IncorrectTypeException
label_desc: Use image node_id 2 for calling a global function with example usage: test_cbva002_callback_return_validation() and returns: set, list, list