code: def test_trendline_enough_values(mode, options):
      fig = px.scatter(
          x=[0, 1], y=[0, 1], trendline=mode, trendline_options=options
      )
      assert len(fig.data) == 2
      assert len(fig.data[1].x) == 2
      fig = px.scatter(
          x=[0], y=[0], trendline=mode, trendline_options=options
      )
      assert len(fig.data) == 2
      assert fig.data[1].x is None
      fig = px.scatter(
          x=[0, 1],
          y=[0, None],
          trendline=mode,
          trendline_options=options,
      )
      assert len(fig.data) == 2
      assert fig.data[1].x is None
      fig = px.scatter(
          x=[0, 1],
          y=np.array([0, np.nan]),
          trendline=mode,
          trendline_options=options,
      )
      assert len(fig.data) == 2
      assert fig.data[1].x is None
      fig = px.scatter(
          x=[0, 1, None],
          y=[0, None, 1],
          trendline=mode,
          trendline_options=options,
      )
      assert len(fig.data) == 2
      assert fig.data[1].x is None
      fig = px.scatter(
          x=np.array([0, 1, np.nan]),
          y=np.array([0, np.nan, 1]),
          trendline=mode,
          trendline_options=options,
      )
      assert len(fig.data) == 2
      assert fig.data[1].x is None
      fig = px.scatter(
          x=[0, 1, None, 2],
          y=[1, None, 1, 2],
          trendline=mode,
          trendline_options=options,
      )
      assert len(fig.data) == 2
      assert len(fig.data[1].x) == 2
      fig = px.scatter(
          x=np.array([0, 1, np.nan, 2]),
          y=np.array([1, np.nan, 1, 2]),
          trendline=mode,
          trendline_options=options,
      )
      assert len(fig.data) == 2
      assert len(fig.data[1].x) == 2
  
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 2 for calling a global function with example usage: test_trendline_enough_values(mode, options) without return types