

def check_oob_score_raise_error(name):
    ForestEstimator = FOREST_ESTIMATORS[name]
    if (name in FOREST_TRANSFORMERS):
        for oob_score in [True, False]:
            assert_raises(TypeError, ForestEstimator, oob_score=oob_score)
        assert_raises(NotImplementedError, ForestEstimator()._set_oob_score, X, y)
    else:
        for (oob_score, bootstrap) in [(True, False), (False, True), (False, False)]:
            est = ForestEstimator(oob_score=oob_score, bootstrap=bootstrap, random_state=0)
            assert_false(hasattr(est, 'oob_score_'))
        assert_raises(ValueError, oob_score(oob_score=True, bootstrap=False).fit, X, y)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/ensemble/tests/test_forest.py check_oob_score_raise_error/VarMisuse@130/190 `ForestEstimator`->`oob_score`