From 464d50a6505c11b38782e09f7a9140912f627926 2012-07-30 22:37:19 From: Thomas Kluyver Date: 2012-07-30 22:37:19 Subject: [PATCH] Add test that numpy, IPython.parallel and IPython.zmq aren't imported on startup. --- diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index 7d255cd..fe01c40 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -33,6 +33,7 @@ import nose.tools as nt # Our own from IPython.testing.decorators import skipif +from IPython.testing import tools as tt from IPython.utils import io #----------------------------------------------------------------------------- @@ -401,6 +402,18 @@ class TestSystemRaw(unittest.TestCase): cmd = ur'''python -c "'åäö'" ''' ip.system_raw(cmd) +class TestModules(unittest.TestCase, tt.TempFileMixin): + def test_extraneous_loads(self): + """Test we're not loading modules on startup that we shouldn't. + """ + self.mktmp("import sys\n" + "print('numpy' in sys.modules)\n" + "print('IPython.parallel' in sys.modules)\n" + "print('IPython.zmq' in sys.modules)\n" + ) + out = "False\nFalse\nFalse\n" + tt.ipexec_validate(self.fname, out) + def test__IPYTHON__(): # This shouldn't raise a NameError, that's all