class_docstr: Tests for purity measurements
class_docstr_tok: ["Tests","for","purity","measurements"]
docstr: Test the ``shape_new`` method.
docstr_tok: ["Test","the","``","shape_new","``","method","."]
code: def test_shape_new(self, shots, shape):
      """Test the ``shape_new`` method."""
      meas = qml.purity(wires=0)
      dev = qml.device("default.qubit", wires=1, shots=shots)
      assert meas.shape(dev, Shots(shots)) == shape
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.measurements import PurityMP, Shots
label_desc: Use image node_id 3 for calling the TestPurityUnitTest obj's underlying member method code with example usage: obj.test_shape_new(shots, shape) without return types