From 8c45772c3ea8798eb4c4ae6a2ebfa6943ecb8fa7 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 10 Mar 2014 17:01:35 -0700 Subject: [PATCH] Refactor generation of casperjs command --- IPython/testing/iptestcontroller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index c4cc93125..71c3b34b3 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -197,6 +197,10 @@ class JSController(TestController): """Create new test runner.""" TestController.__init__(self) self.section = section + js_test_dir = get_js_test_dir() + includes = '--includes=' + os.path.join(js_test_dir,'util.js') + test_cases = os.path.join(js_test_dir, self.section[len(js_prefix):]) + self.cmd = ['casperjs', 'test', includes, test_cases] def setup(self): self.ipydir = TemporaryDirectory() @@ -208,11 +212,7 @@ class JSController(TestController): # start the ipython notebook, so we get the port number self._init_server() - js_test_dir = get_js_test_dir() - includes = '--includes=' + os.path.join(js_test_dir,'util.js') - test_cases = os.path.join(js_test_dir, self.section[len(js_prefix):]) - port = '--port=' + str(self.server_port) - self.cmd = ['casperjs', 'test', port, includes, test_cases] + self.cmd.append('--port=%s' % self.server_port) def print_extra_info(self): print("Running tests with notebook directory %r" % self.nbdir.name)