

def check_max_leaf_nodes_max_depth(name):
    (X, y) = (hastie_X, hastie_y)
    ForestEstimator = FOREST_ESTIMATORS[name]
    est = ForestEstimator(max_depth=1, max_leaf_nodes=4, n_estimators=1, random_state=0).fit(X, y)
    assert_greater(est.estimators_[0].tree_.max_depth, 1)
    est = ForestEstimator(max_depth=1, n_estimators=1, random_state=0).fit(X, y)
    assert_equal(est.estimators_[0].tree_.max_depth, 1)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/ensemble/tests/test_forest.py check_max_leaf_nodes_max_depth/original