docstr: Test that an error is raised when a device with shots=None is used
  to obtain classical shadows
docstr_tok: ["Test","that","an","error","is","raised","when","a","device","with","shots=None","is","used","to","obtain","classical","shadows"]
code: def test_shots_none_error(self):
      """Test that an error is raised when a device with shots=None is used
      to obtain classical shadows"""
      circuit = hadamard_circuit(2, None)
      H = qml.PauliZ(0)
  
      msg = "The number of shots has to be explicitly set on the device when using sample-based measurements"
      with pytest.raises(qml.QuantumFunctionError, match=msg):
          _ = circuit(H, k=10)
  
imports: import autograd.numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import Shots
label_desc: Use image node_id 3 for calling the TestExpvalMeasurement obj's underlying member method code with example usage: obj.test_shots_none_error() without return types