docstr: Run test-cases using the specified method and the supplied signature.
  
  Extract the arguments for the method call from the test case
  dictionary using the supplied keys for the method's signature.
docstr_tok: ["Run","test-cases","using","the","specified","method","and","the","supplied","signature",".","Extract","the","arguments","for","the","method","call","from","the","test","case","dictionary","using","the","supplied","keys","for","the","method","'s","signature","."]
code: def run_tests(
      self,
      tests,
      method,
      name,
      xtol=4 * _FLOAT_EPS,
      rtol=4 * _FLOAT_EPS,
      known_fail=None,
      **kwargs,
  ):
      r"""Run test-cases using the specified method and the supplied signature.
  
      Extract the arguments for the method call from the test case
      dictionary using the supplied keys for the method's signature."""
      # The methods have one of two base signatures:
      # (f, a, b, **kwargs)  # newton
      # (func, x0, **kwargs)  # bisect/brentq/...
      sig = _getargspec(
          method
      )  # ArgSpec with args, varargs, varkw, defaults
      nDefaults = len(sig[3])
      nRequired = len(sig[0]) - nDefaults
      sig_args_keys = sig[0][:nRequired]
      sig_kwargs_keys = []
      if name in ["secant", "newton", "halley"]:
          if name in ["newton", "halley"]:
              sig_kwargs_keys.append("fprime")
              if name in ["halley"]:
                  sig_kwargs_keys.append("fprime2")
          kwargs["tol"] = xtol
      else:
          kwargs["xtol"] = xtol
          kwargs["rtol"] = rtol
  
      results = [
          list(
              self._run_one_test(
                  tc,
                  method,
                  sig_args_keys=sig_args_keys,
                  sig_kwargs_keys=sig_kwargs_keys,
                  **kwargs,
              )
          )
          for tc in tests
      ]
      # results= [[true root, full output, tc], ...]
  
      known_fail = known_fail or []
      notcvgd = [elt for elt in results if not elt[1].converged]
      notcvgd = [
          elt for elt in notcvgd if elt[-1]["ID"] not in known_fail
      ]
      notcvged_IDS = [elt[-1]["ID"] for elt in notcvgd]
      assert_equal([len(notcvged_IDS), notcvged_IDS], [0, []])
  
      # The usable xtol and rtol depend on the test
      tols = {"xtol": 4 * _FLOAT_EPS, "rtol": 4 * _FLOAT_EPS}
      tols.update(**kwargs)
      rtol = tols["rtol"]
      atol = tols.get("tol", tols["xtol"])
  
      cvgd = [elt for elt in results if elt[1].converged]
      approx = [elt[1].root for elt in cvgd]
      correct = [elt[0] for elt in cvgd]
      notclose = [
          [a] + elt
          for a, c, elt in zip(approx, correct, cvgd)
          if not isclose(a, c, rtol=rtol, atol=atol)
          and elt[-1]["ID"] not in known_fail
      ]
      # Evaluate the function and see if is 0 at the purported root
      fvs = [
          tc["f"](aroot, *(tc["args"]))
          for aroot, c, fullout, tc in notclose
      ]
      notclose = [
          [fv] + elt for fv, elt in zip(fvs, notclose) if fv != 0
      ]
      assert_equal([notclose, len(notclose)], [[], 0])
  
imports: from __future__ import division, print_function, absolute_import
  import pytest
  from math import sqrt, exp, sin, cos
  from numpy.testing import assert_warns, assert_, assert_allclose, assert_equal, assert_array_equal
  import numpy
  from numpy import finfo, power, nan, isclose
  from scipy.optimize import zeros, newton, root_scalar
  from scipy._lib._util import getargspec_no_self
  from scipy.optimize._tstutils import get_tests, functions, fstrings
  from scipy._lib._numpy_compat import suppress_warnings
label_desc: Use image node_id 4 for calling the TestBasic obj's underlying member method code with example usage: obj.run_tests(tests, method, name, xtol, rtol, known_fail) without return types