code: def test_error_messages(self):
      # when the count of features change between training and scoring, we raise an exception
      data = pd.DataFrame(
          data={"x": ["A", "B", "C", "A", "B"], "y": [1, 0, 1, 0, 1]}
      )
      data2 = pd.DataFrame(
          data={"x": ["C", "A", "B"], "x2": ["C", "A", "B"]}
      )
      for encoder_name in encoders.__all__:
          with self.subTest(encoder_name=encoder_name):
              enc = getattr(encoders, encoder_name)()
              enc.fit(data.x, data.y)
              self.assertRaises(ValueError, enc.transform, data2)
  
      # supervised encoders must obtain 'y' of the same length as 'x' during training...
      x = ["A", "B", "C"]
      y_good = pd.Series([1, 0, 1])
      y_bad = pd.Series([1, 0, 1, 0])
      for encoder_name in encoders.__all__:
          enc = getattr(encoders, encoder_name)()
          if not enc._get_tags().get("supervised_encoder"):
              continue
          with self.subTest(encoder_name=encoder_name):
              self.assertRaises(ValueError, enc.fit, x, y_bad)
  
          with self.subTest(encoder_name=encoder_name):
              enc.fit(x, y_good)
              self.assertRaises(ValueError, enc.transform, x, y_bad)
  
imports: import warnings
  from datetime import timedelta
  import numpy
  from numpy.testing import assert_array_equal
  import pandas
  import sklearn
  import tests.helpers
  from sklearn.utils.estimator_checks import check_transformer_general, check_transformers_unfitted, check_n_features_in
  from sklearn.compose import ColumnTransformer
  from unittest import TestCase
  from copy import deepcopy
  import category_encoders
label_desc: Use image node_id 35 for calling the TestEncoders obj's underlying member method code with example usage: obj.test_error_messages() without return types