ipython/ipython — pull request #3496 by vitaut (2013-06-30 15:12:56+00:00)
Title: Fix import errors when running tests from the source directory

The proposed PR fixes multiple module import errors when running tests from the IPython source directory using the command python -c "import IPython; IPython.test()" as suggested in the [documentation](http://ipython.org/ipython-doc/stable/development/testing.html#for-the-impatient-running-the-tests):

**********************************************************************
IPython test group: IPython.config
Traceback (most recent call last):
File "/home/viz/workspace/ipython/IPython/testing/iptest.py", line 44, in
from IPython.testing import nosepatch
ImportError: No module named IPython.testing
**********************************************************************
IPython test group: IPython.core
Traceback (most recent call last):
File "/home/viz/workspace/ipython/IPython/testing/iptest.py", line 44, in
from IPython.testing import nosepatch
ImportError: No module named IPython.testing
...

The problem is that the tests are run in a temporary directory and not in the IPython directory and IPython modules are not on the search path. This is fixed by adding the path to IPython directory to the module search path ($PYTHONPATH).