class_docstr: Test the Hadamard gradient transform and edge cases such as non diff parameters, auxiliary wires, etc...
class_docstr_tok: ["Test","the","Hadamard","gradient","transform","and","edge","cases","such","as","non","diff","parameters",",","auxiliary","wires",",","etc","..."]
docstr: Test that an error is raised when the device cannot accept an auxiliary wire
  because it is full.
code: def test_device_not_enough_wires(self, aux_wire):
      """Test that an error is raised when the device cannot accept an auxiliary wire
      because it is full."""
      dev = qml.device("default.qubit", wires=2)
  
      m = qml.expval(qml.PauliZ(0) @ qml.PauliX(1))
      tape = qml.tape.QuantumScript(
          [qml.RX(0.543, wires=[0]), qml.RY(-0.654, wires=[1])], [m]
      )
  
      if aux_wire is None:
          _match = "The device has no free wire for the auxiliary wire."
      else:
          _match = "The requested auxiliary wire is already in use by the circuit."
      with pytest.raises(qml.wires.WireError, match=_match):
          qml.gradients.hadamard_grad(
              tape, aux_wire=aux_wire, device_wires=dev.wires
          )
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 4 for calling the TestHadamardGradEdgeCases obj's underlying member method code with example usage: obj.test_device_not_enough_wires(aux_wire) without return types