def METHOD_NAME():
    """Tests scaling function raise an error on circuits with
    intermediate measurements.
    """
    qbit = LineQubit(0)
    circ = Circuit([ops.H.on(qbit)], [ops.measure(qbit)], [ops.T.on(qbit)])
    with pytest.raises(
        UnscalableCircuitError,
        match="Circuit contains intermediate measurements",
    ):
        insert_id_layers(circ, scale_factor=3.0)