Skip to content

Commit

Permalink
Document base_estimator validation tests
Browse files Browse the repository at this point in the history
- Also rename test functions to be more descriptive
  • Loading branch information
HunterMcGushion committed Jul 14, 2019
1 parent 010c3bd commit 6c89cd0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_optimization/test_protocols.py
Expand Up @@ -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)

Expand Down

0 comments on commit 6c89cd0

Please sign in to comment.