From 6c89cd010f0956d6adbfed4255bce49e7eaa5ef4 Mon Sep 17 00:00:00 2001 From: Hunter McGushion Date: Tue, 9 Jul 2019 17:38:01 -0700 Subject: [PATCH] Document `base_estimator` validation tests - Also rename test functions to be more descriptive --- tests/test_optimization/test_protocols.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_optimization/test_protocols.py b/tests/test_optimization/test_protocols.py index 7c5f14a8..3f343c3d 100644 --- a/tests/test_optimization/test_protocols.py +++ b/tests/test_optimization/test_protocols.py @@ -67,13 +67,18 @@ def pytest_generate_tests(metafunc): ################################################## -# Tests +# `base_estimator` Tests ################################################## -def test_valid(est, opt): +def test_valid_base_estimator(est, opt): + """Test that an OptimizationProtocol does not complain when given a valid `base_estimator`. + Also test that selected strings and Regressor instances are equally valid values. Parametrized + via :func:`pytest_generate_tests`""" opt(base_estimator=est) -def test_invalid(est, opt): +def test_invalid_base_estimator(est, opt): + """Test that an OptimizationProtocol complains when given an invalid `base_estimator`. + Parametrized via :func:`pytest_generate_tests`""" with pytest.raises(TypeError, match="Expected `base_estimator` in .*"): opt(base_estimator=est)