@pytest.mark.parametrize('param_distributions, expected_n_candidates', [({'a': [1, 2]}, 2), ({'a': randint(1, 3)}, 10)])
def test_random_search_discrete_distributions(param_distributions, expected_n_candidates):
    n_samples = 1024
    (X, y) = make_classification(n_samples=n_samples, random_state=0)
    base_estimator = FastClassifier()
    sh = HalvingRandomSearchCV(base_estimator, param_distributions, n_candidates=10)
    sh.fit(X, y)
    assert (sh.n_candidates_[0] == expected_n_candidates)
@pytest.mark.parametrize('param_distributions, expected_n_candidates', [({'a': [1, 2]}, 2), ({'a': randint(1, 3)}, 10)])
def test_random_search_discrete_distributions(param_distributions, expected_n_candidates):
    n_samples = 1024
    (X, y) = make_classification(n_samples=n_samples, random_state=0)
    base_estimator = FastClassifier()
    sh = HalvingRandomSearchCV(base_estimator, param_distributions, n_candidates=10)
    sh.fit(X, y)
    assert (sh.n_candidates_[0] == expected_n_candidates)