code: def test_bad_ratio_errors(self):
      target = DisaggregatedResult.create(
          data=basic_data,
          annotated_functions=metric_dict,
          sensitive_feature_names=["g_1"],
          control_feature_names=None,
      )
      with pytest.raises(ValueError) as e0:
          _ = target.ratio(
              control_feature_names=None,
              method="between_groups",
              errors="bad_option",
          )
      assert (
          str(e0.value)
          == "Invalid error value specified. Valid values are ['raise', 'coerce']"
      )
  
file_path: fairlearn/test/unit/metrics/test_disaggregated_result.py
imports: import pandas
  import pytest
  import sklearn.metrics
  from fairlearn.metrics._annotated_metric_function import AnnotatedMetricFunction
  from fairlearn.metrics._disaggregated_result import DisaggregatedResult
  from .data_for_test import g_1, y_p, y_t
label_desc: Use image node_id 5 for calling the TestErrorMessages obj's underlying member method code with example usage: obj.test_bad_ratio_errors() without return types