Allow unit format names to be case-insensitive (normalizing to lowercase) and include a type check in case the format is not a valid string.
Allow unit format names to be case-insensitive (normalizing to lowercase) and include a type check in case the format is not a valid string.

MSeifert04/astropy,AustereCuriosity/astropy,StuartLittlefair/astropy,funbaker/astropy,dhomeier/astropy,larrybradley/astropy,joergdietrich/astropy,MSeifert04/astropy,bsipocz/astropy,StuartLittlefair/astropy,DougBurke/astropy,bsipocz/astropy,mhvk/astropy,kelle/astropy,dhomeier/astropy,kelle/astropy,pllim/astropy,MSeifert04/astropy,larrybradley/astropy,bsipocz/astropy,stargaser/astropy,astropy/astropy,astropy/astropy,saimn/astropy,AustereCuriosity/astropy,saimn/astropy,joergdietrich/astropy,saimn/astropy,tbabej/astropy,dhomeier/astropy,pllim/astropy,mhvk/astropy,StuartLittlefair/astropy,AustereCuriosity/astropy,DougBurke/astropy,bsipocz/astropy,astropy/astropy,larrybradley/astropy,mhvk/astropy,stargaser/astropy,tbabej/astropy,funbaker/astropy,aleksandr-bakanov/astropy,AustereCuriosity/astropy,saimn/astropy,aleksandr-bakanov/astropy,lpsinger/astropy,dhomeier/astropy,funbaker/astropy,kelle/astropy,joergdietrich/astropy,larrybradley/astropy,astropy/astropy,AustereCuriosity/astropy,stargaser/astropy,lpsinger/astropy,astropy/astropy,aleksandr-bakanov/astropy,funbaker/astropy,kelle/astropy,pllim/astropy,joergdietrich/astropy,tbabej/astropy,pllim/astropy,DougBurke/astropy,tbabej/astropy,joergdietrich/astropy,StuartLittlefair/astropy,mhvk/astropy,larrybradley/astropy,dhomeier/astropy,MSeifert04/astropy,DougBurke/astropy,aleksandr-bakanov/astropy,stargaser/astropy,kelle/astropy,mhvk/astropy,lpsinger/astropy,StuartLittlefair/astropy,tbabej/astropy,saimn/astropy,lpsinger/astropy,lpsinger/astropy,pllim/astropy