##// END OF EJS Templates
Use stream capturer for kernel tests
Thomas Kluyver -
Show More
@@ -14,9 +14,10 b''
14 import atexit
14 import atexit
15
15
16 from contextlib import contextmanager
16 from contextlib import contextmanager
17 from subprocess import PIPE
17 from subprocess import PIPE, STDOUT
18 from Queue import Empty
18 from Queue import Empty
19
19
20 import nose
20 import nose.tools as nt
21 import nose.tools as nt
21
22
22 from IPython.kernel import KernelManager
23 from IPython.kernel import KernelManager
@@ -39,10 +40,12 b' KC = None'
39 def start_new_kernel(argv=None):
40 def start_new_kernel(argv=None):
40 """start a new kernel, and return its Manager and Client"""
41 """start a new kernel, and return its Manager and Client"""
41 km = KernelManager()
42 km = KernelManager()
42 kwargs = dict(stdout=PIPE, stderr=PIPE)
43 kwargs = dict(stdout=PIPE, stderr=STDOUT)
43 if argv:
44 if argv:
44 kwargs['extra_arguments'] = argv
45 kwargs['extra_arguments'] = argv
45 km.start_kernel(**kwargs)
46 km.start_kernel(**kwargs)
47 nose.ipy_stream_capturer.add_stream(km.kernel.stdout.fileno())
48 nose.ipy_stream_capturer.ensure_started()
46 kc = km.client()
49 kc = km.client()
47 kc.start_channels()
50 kc.start_channels()
48
51
General Comments 0
You need to be logged in to leave comments. Login now