class_docstr: Tests for the probs function
class_docstr_tok: ["Tests","for","the","probs","function"]
docstr: Test the probability is correct for a known state preparation.
docstr_tok: ["Test","the","probability","is","correct","for","a","known","state","preparation","."]
code: def test_integration(self, tol, mocker):
      """Test the probability is correct for a known state preparation."""
      dev = qml.device("default.qubit.legacy", wires=2)
      spy = mocker.spy(qml.QubitDevice, "probability")
  
      @qml.qnode(dev)
      def circuit():
          qml.Hadamard(wires=1)
          qml.CNOT(wires=[0, 1])
          return qml.probs(wires=[0, 1])
  
      # expected probability, using [00, 01, 10, 11]
      # ordering, is [0.5, 0.5, 0, 0]
  
      res = circuit()
      expected = np.array([0.5, 0.5, 0, 0])
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
      custom_measurement_process(dev, spy)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ProbabilityMP, Shots
  from pennylane.devices.qubit.measure import flatten_state
label_desc: Use image node_id 10 for calling the TestProbs obj's underlying member method code with example usage: obj.test_integration(tol, mocker) and returns: qml