Show More
@@ -79,6 +79,11 b' class MultiKernelManager(LoggingConfigurable):' | |||
|
79 | 79 | |
|
80 | 80 | The caller can pick a kernel_id by passing one in as a keyword arg, |
|
81 | 81 | otherwise one will be picked using a uuid. |
|
82 | ||
|
83 | To silence the kernel's stdout/stderr, call this using:: | |
|
84 | ||
|
85 | km.start_kernel(stdout=PIPE, stderr=PIPE) | |
|
86 | ||
|
82 | 87 | """ |
|
83 | 88 | kernel_id = kwargs.pop('kernel_id', unicode(uuid.uuid4())) |
|
84 | 89 | if kernel_id in self: |
@@ -1,5 +1,6 b'' | |||
|
1 | 1 | """Tests for the notebook kernel and session manager.""" |
|
2 | 2 | |
|
3 | from subprocess import PIPE | |
|
3 | 4 | import time |
|
4 | 5 | from unittest import TestCase |
|
5 | 6 | |
@@ -20,7 +21,7 b' class TestKernelManager(TestCase):' | |||
|
20 | 21 | return km |
|
21 | 22 | |
|
22 | 23 | def _run_lifecycle(self, km): |
|
23 | kid = km.start_kernel() | |
|
24 | kid = km.start_kernel(stdout=PIPE, stderr=PIPE) | |
|
24 | 25 | self.assertTrue(kid in km) |
|
25 | 26 | self.assertTrue(kid in km.list_kernel_ids()) |
|
26 | 27 | self.assertEqual(len(km),1) |
@@ -40,7 +41,7 b' class TestKernelManager(TestCase):' | |||
|
40 | 41 | self.assertTrue(not kid in km) |
|
41 | 42 | |
|
42 | 43 | def _run_cinfo(self, km, transport, ip): |
|
43 | kid = km.start_kernel() | |
|
44 | kid = km.start_kernel(stdout=PIPE, stderr=PIPE) | |
|
44 | 45 | k = km.get_kernel(kid) |
|
45 | 46 | cinfo = km.get_connection_info(kid) |
|
46 | 47 | self.assertEqual(transport, cinfo['transport']) |
@@ -1,5 +1,6 b'' | |||
|
1 | 1 | """Tests for the notebook kernel and session manager.""" |
|
2 | 2 | |
|
3 | from subprocess import PIPE | |
|
3 | 4 | import time |
|
4 | 5 | from unittest import TestCase |
|
5 | 6 | |
@@ -19,7 +20,7 b' class TestKernelManager(TestCase):' | |||
|
19 | 20 | return km |
|
20 | 21 | |
|
21 | 22 | def _run_lifecycle(self, km): |
|
22 | km.start_kernel() | |
|
23 | km.start_kernel(stdout=PIPE, stderr=PIPE) | |
|
23 | 24 | km.start_channels(shell=True, iopub=False, stdin=False, hb=False) |
|
24 | 25 | km.restart_kernel() |
|
25 | 26 | # We need a delay here to give the restarting kernel a chance to |
@@ -28,7 +29,7 b' class TestKernelManager(TestCase):' | |||
|
28 | 29 | # message for the restart sometimes hasn't been sent to the kernel. |
|
29 | 30 | # Because linger is oo on the shell channel, the context can't |
|
30 | 31 | # close until the message is sent to the kernel, which is not dead. |
|
31 | time.sleep() | |
|
32 | time.sleep(1.0) | |
|
32 | 33 | km.interrupt_kernel() |
|
33 | 34 | self.assertTrue(isinstance(km, KernelManager)) |
|
34 | 35 | km.shutdown_kernel() |
General Comments 0
You need to be logged in to leave comments.
Login now