code: def test_bad_facet_spacing_eror(bad_facet_spacing_df):
      df = bad_facet_spacing_df
      with pytest.raises(
          ValueError,
          match="Use the facet_row_spacing argument to adjust this spacing.",
      ):
          px.scatter(
              df,
              x="x",
              y="y",
              facet_row="category",
              facet_row_spacing=0.01001,
          )
      with pytest.raises(
          ValueError,
          match="Use the facet_col_spacing argument to adjust this spacing.",
      ):
          px.scatter(
              df,
              x="x",
              y="y",
              facet_col="category",
              facet_col_spacing=0.01001,
          )
      # Check error is not raised when the spacing is OK
      try:
          px.scatter(
              df,
              x="x",
              y="y",
              facet_row="category",
              facet_row_spacing=0.01,
          )
      except ValueError:
          # Error shouldn't be raised, so fail if it is
          assert False
      try:
          px.scatter(
              df,
              x="x",
              y="y",
              facet_col="category",
              facet_col_spacing=0.01,
          )
      except ValueError:
          # Error shouldn't be raised, so fail if it is
          assert False
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_px/test_facets.py
imports: import pandas
  import plotly.express
  from pytest import approx
  import pytest
  import random
label_desc: Use image node_id 4 for calling a global function with example usage: test_bad_facet_spacing_eror(bad_facet_spacing_df) without return types