From a4366e86f7459ce166ce71012e2e81e323ef21f4 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 31 Mar 2015 17:37:51 -0700 Subject: [PATCH] install IPython kernel in temp IPython dir --- IPython/testing/iptestcontroller.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index c502d7f5a..6cbc8be4c 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -165,6 +165,16 @@ class PyTestController(TestController): ipydir = TemporaryDirectory() self.dirs.append(ipydir) self.env['IPYTHONDIR'] = ipydir.name + # FIXME: install IPython kernel in temporary IPython dir + # remove after big split + try: + from jupyter_client.kernelspec import KernelSpecManager + except ImportError: + pass + else: + ksm = KernelSpecManager(ipython_dir=ipydir.name) + ksm.install_native_kernel_spec(user=True) + self.workingdir = workingdir = TemporaryDirectory() self.dirs.append(workingdir) self.env['IPTEST_WORKING_DIR'] = workingdir.name