##// END OF EJS Templates
Merge pull request #876 from minrk/customtb...
Merge pull request #876 from minrk/customtb Protect IPython from bad custom exception handlers. Also ensures that ipdb can be used as a tracing debugger in a manner similar to `pdb.set_trace`, via: from IPython.core.debugger import Tracer tracer = Tracer() # then, call tracer() anywhere in the code to start it up.

File last commit:

r4960:7dc06b6e
r5010:aa846e31 merge
Show More
test_kernelsession.py
26 lines | 791 B | text/x-python | PythonLexer
Brian E. Granger
Refactoring the notebook app to support the new config system.
r4344 """Tests for the notebook kernel and session manager."""
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343
from unittest import TestCase
MinRK
use zmq.KernelManager to manage individual kernels in notebook...
r4960 from IPython.frontend.html.notebook.kernelmanager import MultiKernelManager
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343
class TestKernelManager(TestCase):
def test_km_lifecycle(self):
MinRK
use zmq.KernelManager to manage individual kernels in notebook...
r4960 km = MultiKernelManager()
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343 kid = km.start_kernel()
self.assert_(kid in km)
self.assertEquals(len(km),1)
km.kill_kernel(kid)
self.assert_(not kid in km)
kid = km.start_kernel()
self.assertEquals('127.0.0.1',km.get_kernel_ip(kid))
port_dict = km.get_kernel_ports(kid)
self.assert_('stdin_port' in port_dict)
self.assert_('iopub_port' in port_dict)
self.assert_('shell_port' in port_dict)
self.assert_('hb_port' in port_dict)
MinRK
use zmq.KernelManager to manage individual kernels in notebook...
r4960 km.get_kernel(kid)
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343