class_docstr: Tests gradients of univariate unidimensional functions.
docstr: Tests a polynomial function.
docstr_tok: ["Tests","a","polynomial","function","."]
code: def test_poly(self, tol):
      """Tests a polynomial function."""
      x_vals = np.linspace(-10, 10, 16, endpoint=False)
      func = lambda x: 2 * x**2 + 3 * x + 4
      g = qml.grad(func, 0)
      auto_grad = [g(x) for x in x_vals]
      correct_grad = 4 * x_vals + 3
  
      assert np.allclose(auto_grad, correct_grad, atol=tol, rtol=0)
  
imports: import autograd
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 3 for calling the TestGradientUnivar obj's underlying member method code with example usage: obj.test_poly(tol) without return types