class_docstr: Tests that sampling is correctly implemented.
class_docstr_tok: ["Tests","that","sampling","is","correctly","implemented","."]
docstr: Test that the sample function raises an error if the given observable is not supported
docstr_tok: ["Test","that","the","sample","function","raises","an","error","if","the","given","observable","is","not","supported"]
code: def test_sample_error_unsupported_observable(
      self, gaussian_device_2_wires, observable
  ):
      """Test that the sample function raises an error if the given observable is not supported"""
  
      with pytest.raises(
          NotImplementedError,
          match="default.gaussian does not support sampling",
      ):
          gaussian_device_2_wires.sample(observable, [0], [])
  
imports: import numpy
  import numpy.random
  import pytest
  from scipy.linalg import block_diag
  from scipy.special import factorial
  import pennylane
  from pennylane import DeviceError
  from pennylane.devices.default_gaussian import fock_prob, rotation, squeezing, quadratic_phase, beamsplitter, two_mode_squeezing, controlled_addition, controlled_phase, vacuum_state, coherent_state, squeezed_state, displaced_squeezed_state, thermal_state
  from pennylane.wires import Wires
label_desc: Use image node_id 6 for calling the TestSample obj's underlying member method code with example usage: obj.test_sample_error_unsupported_observable(gaussian_device_2_wires, observable) without return types