

def test_constant_strategy_exceptions():
    X = [[0], [0], [0], [0]]
    y = [2, 1, 2, 2]
    clf = DummyClassifier(strategy='constant', random_state=0)
    assert_raises(ValueError, clf.fit, X, y)
    clf = DummyClassifier(strategy='constant', random_state=0, constant=[2, 0])
    assert_raises(ValueError, clf.fit, X, y)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/tests/test_dummy.py test_constant_strategy_exceptions/original