code: def test_encoders_raise_error_when_x_pandas_y_pandas_index_mismatch(
      encoder, df_test
  ):
      """
      Created 2022-03-27 to test fix to issue # 376
      """
  
      X: pd.DataFrame = df_test[["x"]]
      y: pd.Series = df_test["y"]
  
      # Test issue fix where indexes of pandas objects are mismatched
      y = y.reset_index(drop=True)
  
      e: Exception
      with pytest.raises(Exception) as e:
          encoder.fit_transform(X, y)
      assert "indexes" in e.value.args[0].lower()
  
file_path: feature_engine/tests/test_encoding/test_check_estimator_encoders.py
imports: import pandas
  import pytest
  from sklearn.utils.estimator_checks import check_estimator
  from feature_engine.encoding import CountFrequencyEncoder, DecisionTreeEncoder, MeanEncoder, OneHotEncoder, OrdinalEncoder, PRatioEncoder, RareLabelEncoder, WoEEncoder, StringSimilarityEncoder
  from tests.estimator_checks.estimator_checks import check_feature_engine_estimator
label_desc: Use image node_id 5 for calling a global function with example usage: test_encoders_raise_error_when_x_pandas_y_pandas_index_mismatch(encoder, df_test) without return types