code: def test_error_finite_shots():
      """Test that an error is raised if the device has a finite number of shots set."""
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(0.2, wires=0)
          qml.RY(1.9, wires=1)
      tape = qml.tape.QuantumScript.from_queue(q, shots=1)
  
      with pytest.raises(
          ValueError, match="The adjoint method for the metric tensor"
      ):
          qml.adjoint_metric_tensor(tape)
  
imports: import pytest
  from pennylane import numpy
  import pennylane
label_desc: Use image node_id 13 for calling a global function with example usage: test_error_finite_shots() without return types