code: def test_nit_expected(self, case):
      # Test that `_chandrupatla` implements Chandrupatla's algorithm:
      # in all 55 test cases, the number of iterations performed
      # matches the number reported in the original paper.
      func, x1, nit = case
  
      # Find bracket using the algorithm in the paper
      step = 0.2
      x2 = x1 + step
      x1, x2, x3, f1, f2, f3 = _bracket_minimum(func, x1, x2)
  
      # Use tolerances from original paper
      xatol = 0.0001
      fatol = 0.000001
      xrtol = 1e-16
      frtol = 1e-16
  
      res = _chandrupatla_minimize(
          func,
          x1,
          x2,
          x3,
          xatol=xatol,
          fatol=fatol,
          xrtol=xrtol,
          frtol=frtol,
      )
      assert_equal(res.nit, nit)
  
imports: import pytest
  import numpy
  from numpy.testing import assert_allclose, assert_equal, assert_array_less
  from scipy import stats
  import scipy.optimize._chandrupatla
  from scipy.optimize._chandrupatla import _chandrupatla_minimize
  from itertools import permutations
label_desc: Use image node_id 7 for calling the TestChandrupatlaMinimize obj's underlying member method code with example usage: obj.test_nit_expected(case) without return types