def test_only_needed_measures(self):
    'Test that `MeasureChannel`s are only added for measured qubits.'
    q = QuantumRegister(2)
    c = ClassicalRegister(2)
    qc = QuantumCircuit(q, c)
    qc.measure(q[1], c[1])
    sched_all_channels = schedule(qc, self.backend, method='as_soon_as_possible').channels
    deleted_channels = [MeasureChannel(0)]
    self.assertNotIn(sched_all_channels, deleted_channels)
Test that `MeasureChannel`s are only added for measured qubits.
def test_only_needed_measures(self):
    
    q = QuantumRegister(2)
    c = ClassicalRegister(2)
    qc = QuantumCircuit(q, c)
    qc.measure(q[1], c[1])
    sched_all_channels = schedule(qc, self.backend, method='as_soon_as_possible').channels
    deleted_channels = [MeasureChannel(0)]
    self.assertNotIn(sched_all_channels, deleted_channels)