I usually check O2 sensor with a DVM. The failure mode is low voltage, and slow cycleing at idle. Low reading on O2 sensor is lean, and whatever the cause the ECU will adjust fuel trims to try to bring the reading back to normal, Once the short or long term trim runs off the fuel map it sets a CE.
Any leak downstream of the air meter will cause lean readings, enough that during decell it can set a CEL. Theres no fuel to mix with the unmetered air.
O2 sensors do go bad sometimes. Either from age, contact with a rock, or poisoning from antifreeze or silicone that finds its way into the intake. Leaded gass will also ruin an O2 sensor.
John C.