class_docstr: Tests for integration with the PassthruQNode
class_docstr_tok: ["Tests","for","integration","with","the","PassthruQNode"]
docstr: Test that sampling in backpropagation mode raises an error
docstr_tok: ["Test","that","sampling","in","backpropagation","mode","raises","an","error"]
code: def test_sample_backprop_error(self):
      """Test that sampling in backpropagation mode raises an error"""
      # pylint: disable=unused-variable
      dev = qml.device("default.mixed", wires=1, shots=100)
  
      msg = "Backpropagation is only supported when shots=None"
  
      with pytest.raises(qml.QuantumFunctionError, match=msg):
  
          @qml.qnode(dev, diff_method="backprop", interface="torch")
          def circuit(a):
              qml.RY(a, wires=0)
              return qml.sample(qml.PauliZ(0))
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.devices.default_mixed import DefaultMixed
label_desc: Use image node_id 9 for calling the TestPassthruIntegration obj's underlying member method code with example usage: obj.test_sample_backprop_error() and returns: qml