class_docstr: Test suite for algorithm DEHB
class_docstr_tok: ["Test","suite","for","algorithm","DEHB"]
code: def test_is_done_max_trials(self, phase: TestPhase):
      # pylint: disable=invalid-name
      MAX_TRIALS = 10
      algo = self.create_algo()
      algo.algorithm.max_trials = MAX_TRIALS
  
      objective = 0
      while not algo.is_done:
          trials = algo.suggest(1)
  
          assert trials is not None
  
          if trials:
              self.observe_trials(trials, algo, objective)
              objective += len(trials)
  
      # Hyperband should ignore max trials.
      assert algo.n_observed > MAX_TRIALS
      assert algo.is_done
  
file_path: orion/tests/unittests/algo/test_dehb.py
imports: import itertools
  from typing import ClassVar
  import numpy
  import pytest
  from orion.algo.dehb.dehb import UnsupportedConfiguration, import_optional
  from orion.core.utils import backward, format_trials
  from orion.testing.algo import BaseAlgoTests, TestPhase, last_phase_only
label_desc: Use image node_id 8 for calling the TestDEHB obj's underlying member method code with example usage: obj.test_is_done_max_trials(phase) without return types