Enabling ipython testing for affiliated packages

This is a working solution (or just a simple workaround) for #3184, that enables ipython testing for non-core astropy packages. 

I needed this for some investigation in ``photutils`` where normal local testing raises some weird errors (but at least runs in ipython with the change in this PR).