示例#1
0
def test_class_support_removed():
    # Make sure passing classes to check_estimator or parametrize_with_checks
    # raises an error

    msg = "Passing a class was deprecated.* isn't supported anymore"
    with pytest.raises(TypeError, match=msg):
        check_estimator(LogisticRegression)

    with pytest.raises(TypeError, match=msg):
        parametrize_with_checks([LogisticRegression])
示例#2
0
def test_class_support_deprecated():
    # Make sure passing classes to check_estimator or parametrize_with_checks
    # is deprecated

    msg = "Passing a class is deprecated"
    with pytest.warns(FutureWarning, match=msg):
        check_estimator(LogisticRegression)

    with pytest.warns(FutureWarning, match=msg):
        parametrize_with_checks([LogisticRegression])

    # Make sure check_parameters_default_constructible accepts instances now
    check_parameters_default_constructible('name', LogisticRegression())
示例#3
0
def test_estimator_cls_parameterize_with_checks():
    # TODO: remove test in 0.24
    # Non-regression test for #16707 to ensure that parametrize_with_checks
    # works with estimator classes
    param_checks = parametrize_with_checks([LogisticRegression])
    # Using the generator does not raise
    list(param_checks.args[1])