class_docstr: Test the SPSA optimizer.
docstr: Test that if the objective function is not a
  scalar function, an error is raised.
docstr_tok: ["Test","that","if","the","objective","function","is","not","a","scalar","function",",","an","error","is","raised","."]
code: def test_not_A_nor_maxiter_provided(self):
      """Test that if the objective function is not a
      scalar function, an error is raised."""
      with pytest.raises(
          TypeError,
          match="One of the parameters maxiter or A must be provided.",
      ):
          qml.SPSAOptimizer()
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 19 for calling the TestSPSAOptimizer obj's underlying member method code with example usage: obj.test_not_A_nor_maxiter_provided() without return types