Raise exception when running tests inside IPython.
Merge pull request #2684 from mdboom/testing/warn-when-in-ipython

Raise exception when running tests inside IPython.