class_docstr: Tests for the sample function
class_docstr_tok: ["Tests","for","the","sample","function"]
docstr: Test that calling process with an operator that has no eigvals defined raises an error.
docstr_tok: ["Test","that","calling","process","with","an","operator","that","has","no","eigvals","defined","raises","an","error","."]
code: def test_new_sample_with_operator_with_no_eigvals(self):
      """Test that calling process with an operator that has no eigvals defined raises an error."""
  
      class DummyOp(Operator):  # pylint: disable=too-few-public-methods
          num_wires = 1
  
      with pytest.raises(
          EigvalsUndefinedError, match="Cannot compute samples of"
      ):
          qml.sample(op=DummyOp(0)).process_samples(
              samples=np.array([[1, 0]]), wire_order=[0]
          )
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementShapeError, Sample, Shots
  from pennylane.operation import EigvalsUndefinedError, Operator
label_desc: Use image node_id 25 for calling the TestSample obj's underlying member method code with example usage: obj.test_new_sample_with_operator_with_no_eigvals() without return types