class_docstr: Test for the properties
class_docstr_tok: ["Test","for","the","properties"]
docstr: Test that providing both wires and an observable
  results in an error
docstr_tok: ["Test","that","providing","both","wires","and","an","observable","results","in","an","error"]
code: def test_error_obs_and_wires(self):
      """Test that providing both wires and an observable
      results in an error"""
      obs = qml.Hermitian(np.diag([1, 2, 3, 4]), wires=[0, 1])
  
      with pytest.raises(ValueError, match="Cannot set the wires"):
          ExpectationMP(obs=obs, wires=qml.wires.Wires([0, 1]))
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import ClassicalShadowMP, Counts, CountsMP, Expectation, ExpectationMP, MeasurementProcess, MeasurementTransform, MeasurementValue, MidMeasure, MidMeasureMP, MutualInfoMP, PurityMP, Probability, ProbabilityMP, Sample, SampleMeasurement, SampleMP, ShadowExpvalMP, Shots, State, StateMeasurement, StateMP, Variance, VarianceMP, VnEntropyMP, expval, sample, var
  from pennylane.operation import DecompositionUndefinedError
  from pennylane.queuing import AnnotatedQueue
  from pennylane.wires import Wires
label_desc: Use image node_id 5 for calling the TestProperties obj's underlying member method code with example usage: obj.test_error_obs_and_wires() without return types