code: def check_error_if_y_not_passed(estimator):
      """
      Checks that transformer raises error when y is not passed during fit. Functionality
      is provided by Python, when making a parameter mandatory.
  
      For this test to run, we need to add the tag 'requires_y' to the transformer.
      """
      X, y = test_df()
      estimator = clone(estimator)
      with pytest.raises(TypeError):
          estimator.fit(X)
  
imports: import pytest
  from sklearn import clone
  from tests.estimator_checks.dataframe_for_checks import test_df
label_desc: Use image node_id 2 for calling a global function with example usage: check_error_if_y_not_passed(estimator) without return types