code: def test_trailing_underscore_errors(some_fig):
      # get error string but alter it to form the final expected string
      def _raise_bad_property_path_form():
          some_fig.update_layout(title_text_bogus="hi")
  
      def _raise_bad_property_path_real():
          some_fig.update_layout(title_text_="hi")
  
      correct_err_str = form_error_string(
          _raise_bad_property_path_form,
          ValueError,
          [
              (
                  "Property does not support subscripting",
                  "Property does not support subscripting and path has trailing underscores",
              ),
              ("text_bogus", "text_"),
              ("^^^^", "^^^^^"),
          ],
      )
      # no need to replace ^^^^^ because bogus and text_ are same length
      check_error_string(
          _raise_bad_property_path_real, ValueError, correct_err_str, []
      )
  
imports: import plotly.graph_objects
  from _plotly_utils.exceptions import PlotlyKeyError
  import pytest
label_desc: Use image node_id 13 for calling a global function with example usage: test_trailing_underscore_errors(some_fig) without return types