def test_not_allowed_status(self): """Other than `Trial.allowed_stati` are not allowed in `Trial.status`.""" t = Trial() with pytest.raises(ValueError): t.status = 'asdf' with pytest.raises(ValueError): t = Trial(status='ispi')
def fetch_lost_trials(self, query): trial_object = Trial(**trial) trial_object.status = 'reserved' return [trial_object]
def _add_result(trial: Trial, y: float) -> Trial: trial = copy.deepcopy(trial) trial.results = [_result(y)] trial.status = "completed" return trial