Some LEDs have a maximum reverse voltage rating as low as 4V, though 5V is more typical. Their actual breakdown voltage may be significantly higher, but if you don't stay within the ratings, here be dragons! There is the possibility of localised avalanche breakdown of the junction resulting in hotspot damage resulting in reduced emission or total failure when its forward biassed again. Build your tester, but add a LDO 5V regulator to keep the maximum voltage applied safe. Assume the minimum Vf you'll ever see will be 1.2V, if you want 25mA, and the supply voltage is 5V, 150R would be a good resistor to use. Even if you connect that to a 3.5V Vf white or blue LED, you'll still get 10mA. You probably don't need anything like that current for a LED tester, so may want to increase the resistor value.
Once you've identified a few, if they have clear lenses, you may be able to see the lead-frame which is commonly asymmetric due to the die attach area. If so, you will find that for most types of LED, the polarity tends to match up consistently with the lead-frame orientation.