code: def test_diversity_metric_ratio(create_X_y):
      X, y = create_X_y
  
      test = DESClustering(metric_diversity="ratio")
      # Mocking this method to avoid preprocessing the cluster
      # information that is not required in this test.
      test._preprocess_clusters = MagicMock(return_value=1)
      test.fit(X, y)
      assert test.diversity_func_ == ratio_errors
  
imports: from unittest.mock import MagicMock
  import numpy
  import pytest
  from sklearn.cluster import KMeans
  from sklearn.linear_model import Perceptron
  from sklearn.utils.estimator_checks import check_estimator
  from deslib.des.des_clustering import DESClustering
  from deslib.util.diversity import Q_statistic, ratio_errors, negative_double_fault
label_desc: Use image node_id 13 for calling a global function with example usage: test_diversity_metric_ratio(create_X_y) without return types