##// END OF EJS Templates
Cleaning up MultiKernelManager test and adding linger=0 to shell....
Brian Granger -
Show More
@@ -31,37 +31,30 class TestKernelManager(TestCase):
31 31 km.shutdown_kernel(kid)
32 32 self.assertTrue(not kid in km)
33 33
34 def test_km_tcp(self):
35 km = self._get_tcp_km()
36 self._run_lifecycle(km)
37
38 def test_km_ipc(self):
39 km = self._get_ipc_km()
40 self._run_lifecycle(km)
41
42 def test_tcp_cinfo(self):
43 km = self._get_tcp_km()
34 def _run_cinfo(self, km, transport, ip):
44 35 kid = km.start_kernel()
45 36 k = km.get_kernel(kid)
46 37 cinfo = km.get_connection_info(kid)
47 self.assertEqual('tcp', cinfo['transport'])
48 self.assertEqual('127.0.0.1', cinfo['ip'])
38 self.assertEqual(transport, cinfo['transport'])
39 self.assertEqual(ip, cinfo['ip'])
49 40 self.assertTrue('stdin_port' in cinfo)
50 41 self.assertTrue('iopub_port' in cinfo)
51 42 self.assertTrue('shell_port' in cinfo)
52 43 self.assertTrue('hb_port' in cinfo)
53 44 km.shutdown_kernel(kid)
54 45
46 def test_km_tcp(self):
47 km = self._get_tcp_km()
48 self._run_lifecycle(km)
49
50 def test_tcp_cinfo(self):
51 km = self._get_tcp_km()
52 self._run_cinfo(km, 'tcp', '127.0.0.1')
53
54 def test_km_ipc(self):
55 km = self._get_ipc_km()
56 self._run_lifecycle(km)
57
55 58 def test_ipc_cinfo(self):
56 59 km = self._get_ipc_km()
57 kid = km.start_kernel()
58 k = km.get_kernel(kid)
59 cinfo = km.get_connection_info(kid)
60 self.assertEqual('ipc', cinfo['transport'])
61 self.assertEqual('test', cinfo['ip'])
62 self.assertTrue('stdin_port' in cinfo)
63 self.assertTrue('iopub_port' in cinfo)
64 self.assertTrue('shell_port' in cinfo)
65 self.assertTrue('hb_port' in cinfo)
66 km.shutdown_kernel(kid)
67
60 self._run_cinfo(km, 'ipc', 'test')
@@ -201,6 +201,7 class ShellChannel(ZMQSocketChannel):
201 201 """The thread's main activity. Call start() instead."""
202 202 self.socket = self.context.socket(zmq.DEALER)
203 203 self.socket.setsockopt(zmq.IDENTITY, self.session.bsession)
204 self.socket.linger = 0
204 205 self.socket.connect(self.address)
205 206 self.stream = zmqstream.ZMQStream(self.socket, self.ioloop)
206 207 self.stream.on_recv(self._handle_recv)
General Comments 0
You need to be logged in to leave comments. Login now