@pytest.mark.parametrize('params, expected_error_message', [({'n_candidates': 'exhaust', 'min_resources': 'exhaust'}, "cannot be both set to 'exhaust'"), ({'n_candidates': 'bad'}, "either 'exhaust' or a positive integer"), ({'n_candidates': 0}, "either 'exhaust' or a positive integer")])
def test_input_errors_randomized(params, expected_error_message):
    base_estimator = FastClassifier()
    param_grid = {'a': [1]}
    (X, y) = make_classification(100)
    sh = HalvingRandomSearchCV(base_estimator, param_grid, **params)
    with pytest.raises(ValueError, match=expected_error_message):
        sh.fit(X, y)
@pytest.mark.parametrize('params, expected_error_message', [({'n_candidates': 'exhaust', 'min_resources': 'exhaust'}, "cannot be both set to 'exhaust'"), ({'n_candidates': 'bad'}, "either 'exhaust' or a positive integer"), ({'n_candidates': 0}, "either 'exhaust' or a positive integer")])
def test_input_errors_randomized(params, expected_error_message):
    base_estimator = FastClassifier()
    param_grid = {'a': [1]}
    (X, y) = make_classification(100)
    sh = HalvingRandomSearchCV(base_estimator, param_grid, **params)
    with pytest.raises(ValueError, match=expected_error_message):
        sh.fit(X, y)