code: def test_bad_extra_range_only_immediate_refs(self) -> None:
      # test whether adding a figure (*and* it's extra ranges)
      # to another's references doesn't create a false positive
      p, dep = figure(), figure()
      dep.extra_x_ranges["foo"] = Range1d()
      dep.grid.x_range_name = "foo"
      p.grid[0].js_on_change(
          "dimension", CustomJS(code="", args={"toto": dep.grid[0]})
      )
      with mock.patch("bokeh.core.validation.check.log") as mock_logger:
          issues = check_integrity([p])
          process_validation_issues(issues)
      assert mock_logger.error.call_count == 0
  
imports: from __future__ import annotations
  import pytest
  from math import isnan
  from unittest import mock
  from unittest.mock import MagicMock, patch
  import xyzservices.providers
  from bokeh.core.validation import check_integrity, process_validation_issues
  from bokeh.models import CategoricalScale, CustomJS, DataRange1d, FactorRange, GlyphRenderer, Label, LinearAxis, LinearScale, LogScale, PanTool, Plot, Range1d, ResetTool, Title, WMTSTileSource, ZoomInTool, ZoomOutTool
  from bokeh.plotting import figure
  import bokeh.models.plots
label_desc: Use image node_id 5 for calling the TestPlotValidation obj's underlying member method code with example usage: obj.test_bad_extra_range_only_immediate_refs() without return types