code: def test_trendline_results_passthrough(mode, options):
      df = px.data.gapminder().query("continent == 'Oceania'")
      fig = px.scatter(
          df,
          x="year",
          y="pop",
          color="country",
          trendline=mode,
          trendline_options=options,
      )
      assert len(fig.data) == 4
      for trace in fig["data"][0::2]:
          assert "trendline" not in trace.hovertemplate
      for trendline in fig["data"][1::2]:
          assert "trendline" in trendline.hovertemplate
          if mode == "ols":
              assert "R<sup>2</sup>" in trendline.hovertemplate
      results = px.get_trendline_results(fig)
      if mode == "ols":
          assert len(results) == 2
          assert results["country"].values[0] == "Australia"
          au_result = results["px_fit_results"].values[0]
          assert len(au_result.params) == 2
      else:
          assert len(results) == 0
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_px/test_trendline.py
imports: import plotly.express
  import numpy
  import pandas
  import pytest
  from datetime import datetime
label_desc: Use image node_id 1 for calling a global function with example usage: test_trendline_results_passthrough(mode, options) without return types