docstr: Invoke halley through root_scalar()
docstr_tok: ["Invoke","halley","through","root_scalar","(",")"]
code: def test_halley_by_name(self):
      r"""Invoke halley through root_scalar()"""
      for f, f_1, f_2 in [(f1, f1_1, f1_2), (f2, f2_1, f2_2)]:
          r = root_scalar(
              f,
              method="halley",
              x0=3,
              fprime=f_1,
              fprime2=f_2,
              xtol=1e-6,
          )
          assert_allclose(f(r.root), 0, atol=1e-6)
  
imports: import pytest
  from math import sqrt, exp, sin, cos
  from functools import lru_cache
  from numpy.testing import assert_warns, assert_, assert_allclose, assert_equal, assert_array_equal, suppress_warnings
  import numpy
  from numpy import finfo, power, nan, isclose
  from scipy.optimize import zeros, newton, root_scalar
  from scipy._lib._util import getfullargspec_no_self
  from scipy.optimize._tstutils import get_tests, functions, fstrings
label_desc: Use image node_id 23 for calling the TestBasic obj's underlying member method code with example usage: obj.test_halley_by_name() without return types