code: def test_find_or_check_categorical_variables_when_numeric_is_cast_as_category_or_object(
      df_vartypes, _num_var, _cat_type
  ):
      df_vartypes = _cast_var_as_type(df_vartypes, _num_var, _cat_type)
      assert _find_or_check_categorical_variables(
          df_vartypes, _num_var
      ) == [_num_var]
      assert _find_or_check_categorical_variables(
          df_vartypes, None
      ) == [
          "Name",
          "City",
          _num_var,
      ]
      assert _find_or_check_categorical_variables(
          df_vartypes, ["Name", _num_var]
      ) == [
          "Name",
          _num_var,
      ]
  
file_path: feature_engine/tests/test_variable_handling/test_variable_type_selection.py
imports: import pandas
  import pytest
  from feature_engine._variable_handling.variable_type_selection import _filter_out_variables_not_in_dataframe, _find_all_variables, _find_categorical_and_numerical_variables, _find_or_check_categorical_variables, _find_or_check_datetime_variables, _find_or_check_numerical_variables
label_desc: Use image node_id 4 for calling a global function with example usage: test_find_or_check_categorical_variables_when_numeric_is_cast_as_category_or_object(df_vartypes, _num_var, _cat_type) without return types