def METHOD_NAME(monkeypatch, dumbalgo):
    """Check whether algorithm will stop with base algorithm max_trials check"""
    monkeypatch.delattr(dumbalgo, "is_done")
    space = Space()
    space.register(Real("yolo1", "uniform", 1, 4))
    algo = dumbalgo(space)
    algo.suggest(5)
    for i in range(1, 5):
        backward.algo_observe(
            algo, [format_trials.tuple_to_trial((i,), space)], [dict(objective=3)]
        )
    assert len(algo.state_dict["registry"]["_trials"]) == 4
    assert not algo.is_done
    dumbalgo.max_trials = 4
    assert algo.is_done