code: def test_args(self):
      prob = MaratosTestArgs("a", 234)
  
      result = minimize(
          prob.fun,
          prob.x0,
          ("a", 234),
          method="trust-constr",
          jac=prob.grad,
          hess=prob.hess,
          bounds=prob.bounds,
          constraints=prob.constr,
      )
  
      if prob.x_opt is not None:
          assert_array_almost_equal(result.x, prob.x_opt, decimal=2)
  
      # gtol
      if result.status == 1:
          assert_array_less(result.optimality, 1e-8)
      # xtol
      if result.status == 2:
          assert_array_less(result.tr_radius, 1e-8)
          if result.method == "tr_interior_point":
              assert_array_less(result.barrier_parameter, 1e-8)
      # max iter
      if result.status in (0, 3):
          raise RuntimeError("Invalid termination condition.")
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import pytest
  from scipy.linalg import block_diag
  from scipy.sparse import csc_matrix
  from numpy.testing import TestCase, assert_array_almost_equal, assert_array_less, assert_allclose, assert_
  from pytest import raises
  from scipy.optimize import NonlinearConstraint, LinearConstraint, Bounds, minimize, BFGS, SR1
  from scipy._lib._numpy_compat import suppress_warnings
label_desc: Use image node_id 6 for calling the TestTrustRegionConstr obj's underlying member method code with example usage: obj.test_args() without return types