log hyperopt progress to stdout instead to the logger

This commit is contained in:
gcarq
2018-03-25 22:57:40 +02:00
parent 403f59ef45
commit f4077a51c1
2 changed files with 5 additions and 4 deletions

View File

@@ -124,7 +124,7 @@ def test_loss_calculation_has_limited_profit(init_hyperopt) -> None:
assert under > correct
def test_log_results_if_loss_improves(init_hyperopt, caplog) -> None:
def test_log_results_if_loss_improves(init_hyperopt, capsys) -> None:
hyperopt = _HYPEROPT
hyperopt.current_best_loss = 2
hyperopt.log_results(
@@ -135,7 +135,8 @@ def test_log_results_if_loss_improves(init_hyperopt, caplog) -> None:
'result': 'foo'
}
)
assert log_has(' 1/2: foo. Loss 1.00000', caplog.record_tuples)
out, err = capsys.readouterr()
assert ' 1/2: foo. Loss 1.00000'in out
def test_no_log_if_loss_does_not_improve(init_hyperopt, caplog) -> None: