class_docstr: Test that the supported configurations in the documentation
  matches the supported configurations in the code.
  
  Also test that the supported configurations do not raise any errors and
  the unsupported configurations raise the expected errors or otherwise
  behave as expected.
  
  These tests do not test for correctness.
class_docstr_tok: ["Test","that","the","supported","configurations","in","the","documentation","matches","the","supported","configurations","in","the","code",".","Also","test","that","the","supported","configurations","do","not","raise","any","errors","and","the","unsupported","configurations","raise","the","expected","errors","or","otherwise","behave","as","expected",".","These","tests","do","not","test","for","correctness","."]
docstr: Test diff_method "hadamard" works for all interfaces and
  return_types except State, DensityMatrix and Var
docstr_tok: ["Test","diff_method","``","hadamard","''","works","for","all","interfaces","and","return_types","except","State",",","DensityMatrix","and","Var"]
code: def test_all_hadamard_nonstate_non_var(
      self, interface, return_type, shots, wire_specs, diff_method
  ):
      """Test diff_method "hadamard" works for all interfaces and
      return_types except State, DensityMatrix and Var"""
      # correctness is already tested in other test files
      circuit = get_qnode(
          interface, diff_method, return_type, shots, wire_specs
      )
      x = get_variable(interface, wire_specs)
      if return_type in (VnEntropy, MutualInfo):
          if shots:
              err_cls = qml.DeviceError
              msg = "not accepted with finite shots"
          else:
              err_cls = ValueError
              msg = "Computing the gradient of circuits that return the state with the Hadamard test gradient transform is not supported"
          with pytest.raises(err_cls, match=msg):
              compute_gradient(x, interface, circuit, return_type)
      elif return_type == Variance:
          with pytest.raises(
              ValueError,
              match=(
                  "Computing the gradient of variances with the Hadamard test "
                  "gradient transform is not supported."
              ),
          ):
              compute_gradient(x, interface, circuit, return_type)
      else:
          compute_gradient(x, interface, circuit, return_type)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import QuantumFunctionError
  from pennylane.measurements import Probability, Expectation, Variance, Sample, VnEntropy, MutualInfo
  from pennylane.measurements.measurements import ObservableReturnTypes
label_desc: Use image node_id 16 for calling the TestSupportedConfs obj's underlying member method code with example usage: obj.test_all_hadamard_nonstate_non_var(interface, return_type, shots, wire_specs, diff_method) without return types