class_docstr: Test suite for algorithm PB2
docstr: Copied from TestGenericPBT
code: def test_is_done_max_trials(self, num):
      """Copied from TestGenericPBT"""
      space = self.create_space()
  
      local_max_trials = 10
      algo = self.create_algo(space=space)
      algo.algorithm.max_trials = local_max_trials
  
      rng = numpy.random.RandomState(123456)
  
      while not algo.is_done:
          trials = algo.suggest(num)
          assert trials is not None
          if trials:
              self.observe_trials(trials, algo, rng)
  
      # BPT should ignore max trials.
      assert algo.n_observed > local_max_trials
      # BPT should stop when all trials of last generation are completed.
      assert algo.n_observed == population_size * (generations + 1)
      assert algo.is_done
  
file_path: orion/tests/unittests/algo/pbt/test_pb2.py
imports: from __future__ import annotations
  from typing import ClassVar
  import numpy
  import pytest
  from orion.algo.pbt.pb2_utils import import_optional
  from orion.testing.algo import BaseAlgoTests, TestPhase
label_desc: Use image node_id 3 for calling the TestPB2 obj's underlying member method code with example usage: obj.test_is_done_max_trials(num) without return types