class_docstr: Tests for the expval function
class_docstr_tok: ["Tests","for","the","expval","function"]
docstr: Test that the observable is copied if present.
docstr_tok: ["Test","that","the","observable","is","copied","if","present","."]
code: def test_copy_observable(self):
      """Test that the observable is copied if present."""
      m = qml.expval(qml.PauliX(0))
      copied_m = copy.copy(m)
      assert m.obs is not copied_m.obs
      assert qml.equal(m.obs, copied_m.obs)
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane.measurements import Expectation, Shots
  from pennylane.measurements.expval import ExpectationMP
label_desc: Use image node_id 12 for calling the TestExpval obj's underlying member method code with example usage: obj.test_copy_observable() without return types