Fix issue in astropy.utils.console with importing IPython when using py.test. The issue is that py.test sets sys.stdin to a custom handler, which confuses IPython. However, the import statement should not be needed if we are not in IPython mode, and if we are in IPython mode, IPython has already been imported before py.test is run.
Fix issue in astropy.utils.console with importing IPython when using py.test. The issue is that py.test sets sys.stdin to a custom handler, which confuses IPython. However, the import statement should not be needed if we are not in IPython mode, and if we are in IPython mode, IPython has already been imported before py.test is run.

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