def test_program_match_last(): first = DefCalibration("X", [], [Qubit(0)], ["foo"]) second = DefCalibration("X", [], [Qubit(0)], ["bar"]) prog = Program(first, second) match = prog.match_calibrations(Gate("X", [], [Qubit(0)])) assert match == CalibrationMatch(cal=second, settings={})