code: def test_newdatain_hover_data():
      hover_dicts = [
          {"comment": ["a", "b", "c"]},
          {"comment": (1.234, 45.3455, 5666.234)},
          {"comment": [1.234, 45.3455, 5666.234]},
          {"comment": np.array([1.234, 45.3455, 5666.234])},
          {"comment": pd.Series([1.234, 45.3455, 5666.234])},
      ]
      for hover_dict in hover_dicts:
          fig = px.scatter(
              x=[1, 2, 3], y=[3, 4, 5], hover_data=hover_dict
          )
          assert (
              fig.data[0].hovertemplate
              == "x=%{x}<br>y=%{y}<br>comment=%{customdata[0]}<extra></extra>"
          )
      fig = px.scatter(
          x=[1, 2, 3],
          y=[3, 4, 5],
          hover_data={"comment": (True, ["a", "b", "c"])},
      )
      assert (
          fig.data[0].hovertemplate
          == "x=%{x}<br>y=%{y}<br>comment=%{customdata[0]}<extra></extra>"
      )
      hover_dicts = [
          {"comment": (":.1f", (1.234, 45.3455, 5666.234))},
          {"comment": (":.1f", [1.234, 45.3455, 5666.234])},
          {"comment": (":.1f", np.array([1.234, 45.3455, 5666.234]))},
          {"comment": (":.1f", pd.Series([1.234, 45.3455, 5666.234]))},
      ]
      for hover_dict in hover_dicts:
          fig = px.scatter(
              x=[1, 2, 3],
              y=[3, 4, 5],
              hover_data=hover_dict,
          )
          assert (
              fig.data[0].hovertemplate
              == "x=%{x}<br>y=%{y}<br>comment=%{customdata[0]:.1f}<extra></extra>"
          )
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_px/test_px_hover.py
imports: import plotly.express
  import numpy
  import pandas
  import pytest
  from collections import OrderedDict
label_desc: Use image node_id 4 for calling a global function with example usage: test_newdatain_hover_data() without return types