class_docstr: Tests for the validate measurements transform.
class_docstr_tok: ["Tests","for","the","validate","measurements","transform","."]
docstr: Test that an analytic circuit containing SampleMeasurements raises an error
docstr_tok: ["Test","that","an","analytic","circuit","containing","SampleMeasurements","raises","an","error"]
code: def test_analytic_with_samples(self, measurements):
      """Test that an analytic circuit containing SampleMeasurements raises an error"""
      tape = QuantumScript([], measurements, shots=None)
  
      msg = "not accepted for analytic simulation on device"
      with pytest.raises(DeviceError, match=msg):
          validate_measurements(tape)
  
imports: import pytest
  import pennylane
  from pennylane.operation import Operation
  from pennylane.tape import QuantumScript
  from pennylane import DeviceError
  from pennylane.devices.preprocess import no_sampling, validate_device_wires, validate_multiprocessing_workers, validate_adjoint_trainable_params, _operator_decomposition_gen, decompose, validate_observables, validate_measurements
label_desc: Use image node_id 3 for calling the TestValidateMeasurements obj's underlying member method code with example usage: obj.test_analytic_with_samples(measurements) without return types