diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 9e02c9a..6e52436 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -167,13 +167,12 @@ class JSController(TestController): self.section = section self.ipydir = TemporaryDirectory() - self.nbdir = os.path.join(self.ipydir.name, 'notebooks') - print("Running notebook tests in directory: %r" % self.nbdir) - os.makedirs(os.path.join(self.nbdir, 'subdir1/subdir1a')) - os.makedirs(os.path.join(self.nbdir, 'subdir2/subdir2a')) - # print(self.ipydir.name) + self.nbdir = TemporaryDirectory() + print("Running notebook tests in directory: %r" % self.nbdir.name) + os.makedirs(os.path.join(self.nbdir.name, os.path.join('subdir1', 'subdir1a'))) + os.makedirs(os.path.join(self.nbdir.name, os.path.join('subdir2', 'subdir2a'))) self.dirs.append(self.ipydir) - self.env['IPYTHONDIR'] = self.ipydir.name + self.dirs.append(self.nbdir) def launch(self): # start the ipython notebook, so we get the port number @@ -195,7 +194,7 @@ class JSController(TestController): def _init_server(self): "Start the notebook server in a separate process" self.queue = q = Queue() - self.server = Process(target=run_webapp, args=(q, self.ipydir.name, self.nbdir)) + self.server = Process(target=run_webapp, args=(q, self.ipydir.name, self.nbdir.name)) self.server.start() self.server_port = q.get() @@ -212,12 +211,11 @@ def run_webapp(q, ipydir, nbdir, loglevel=0): import IPython.html.notebookapp as nbapp import sys sys.stderr = open(os.devnull, 'w') - os.environ["IPYTHONDIR"] = ipydir server = nbapp.NotebookApp() args = ['--no-browser'] - args.append('--notebook-dir='+nbdir) - args.append('--profile-dir='+ipydir) - args.append('--log-level='+str(loglevel)) + args.extend(['--ipython-dir', ipydir]) + args.extend(['--notebook-dir', nbdir]) + args.extend(['--log-level', str(loglevel)]) server.initialize(args) # communicate the port number to the parent process q.put(server.port)