def test_rigetti_qcs_aspen_device_invalid_qubit(
    qubit: cirq.Qid, qcs_aspen8_isa: InstructionSetArchitecture
):
    """test RigettiQCSAspenDevice throws error on invalid qubits"""
    device = RigettiQCSAspenDevice(isa=qcs_aspen8_isa)
    with pytest.raises(UnsupportedQubit):
        device.validate_qubit(qubit)
    with pytest.raises(UnsupportedQubit):
        device.validate_operation(cirq.I(qubit))
test RigettiQCSAspenDevice throws error on invalid qubits
cirq-rigetti/cirq_rigetti/aspen_device_test.py