def METHOD_NAME(self):
    """Test that executing a state measurement with shots raises a warning."""
    class MyMeasurement(StateMeasurement):
        def process_state(self, state, wire_order):
            return qml.math.sum(state)
    dev = qml.device("default.qubit.legacy", wires=2, shots=1000)
    @qml.qnode(dev)
    def circuit():
        return MyMeasurement()
    with pytest.warns(
        UserWarning,
        match="Requested measurement MyMeasurement with finite shots",
    ):
        circuit()