skip certain tests if keyring not available

... and do it in a 2.5 compatible way