Add test to ensure --hyperopt-loss is mandatory

This commit is contained in:
Matthias
2020-10-05 20:36:16 +02:00
parent 14e87ed4a1
commit 8c2f763193
3 changed files with 8 additions and 5 deletions

View File

@@ -230,6 +230,13 @@ def test_hyperoptresolver_noname(default_conf):
HyperOptResolver.load_hyperopt(default_conf)
def test_hyperoptlossresolver_noname(default_conf):
with pytest.raises(OperationalException,
match="No Hyperopt loss set. Please use `--hyperopt-loss` to specify "
"the Hyperopt-Loss class to use."):
HyperOptLossResolver.load_hyperoptloss(default_conf)
def test_hyperoptlossresolver(mocker, default_conf) -> None:
hl = DefaultHyperOptLoss