def METHOD_NAME(self):
    """Test that executing a sampled measurement with ``shots=None`` raises an error."""
    class MyMeasurement(SampleMeasurement):
        # pylint: disable=signature-differs
        def process_samples(self, samples, wire_order, shot_range, bin_size):
            return qml.math.sum(samples[..., self.wires])
    dev = qml.device("default.qubit.legacy", wires=2)
    @qml.qnode(dev)
    def circuit():
        qml.PauliX(0)
        return MyMeasurement(wires=[0]), MyMeasurement(wires=[1])
    with pytest.raises(
        ValueError, match="Shots must be specified in the device to compute the measurement "
    ):
        circuit()