code: def test_iteration(self):
      # test that DifferentialEvolutionSolver is iterable
      # if popsize is 3 then the overall generation has size (6,)
      solver = DifferentialEvolutionSolver(
          rosen, self.bounds, popsize=3, maxfun=12
      )
      x, fun = next(solver)
      assert_equal(np.size(x, 0), 2)
  
      # 6 nfev are required for initial calculation of energies, 6 nfev are
      # required for the evolution of the 6 population members.
      assert_equal(solver._nfev, 12)
  
      # the next generation should halt because it exceeds maxfun
      assert_raises(StopIteration, next, solver)
  
      # check a proper minimisation can be done by an iterable solver
      solver = DifferentialEvolutionSolver(rosen, self.bounds)
      for i, soln in enumerate(solver):
          x_current, fun_current = soln
          # need to have this otherwise the solver would never stop.
          if i == 1000:
              break
  
      assert_almost_equal(fun_current, 0)
  
imports: import multiprocessing
  from scipy.optimize import _differentialevolution
  from scipy.optimize._differentialevolution import DifferentialEvolutionSolver
  from scipy.optimize import differential_evolution
  import numpy
  from scipy.optimize import rosen
  from numpy.testing import assert_equal, assert_allclose, assert_almost_equal, assert_string_equal, assert_
  from pytest import raises, warns
label_desc: Use image node_id 29 for calling the TestDifferentialEvolutionSolver obj's underlying member method code with example usage: obj.test_iteration() without return types