##// END OF EJS Templates
Notebook actually gets and holds ename, not etype
Maxim Grechkin -
Show More
@@ -53,7 +53,7 b' def from_dict(d):'
53 def new_output(output_type=None, output_text=None, output_png=None,
53 def new_output(output_type=None, output_text=None, output_png=None,
54 output_html=None, output_svg=None, output_latex=None, output_json=None,
54 output_html=None, output_svg=None, output_latex=None, output_json=None,
55 output_javascript=None, output_jpeg=None, prompt_number=None,
55 output_javascript=None, output_jpeg=None, prompt_number=None,
56 etype=None, evalue=None, traceback=None, stream=None):
56 ename=None, evalue=None, traceback=None, stream=None):
57 """Create a new code cell with input and output"""
57 """Create a new code cell with input and output"""
58 output = NotebookNode()
58 output = NotebookNode()
59 if output_type is not None:
59 if output_type is not None:
@@ -82,8 +82,8 b' def new_output(output_type=None, output_text=None, output_png=None,'
82 output.prompt_number = int(prompt_number)
82 output.prompt_number = int(prompt_number)
83
83
84 if output_type == u'pyerr':
84 if output_type == u'pyerr':
85 if etype is not None:
85 if ename is not None:
86 output.etype = unicode(etype)
86 output.ename = unicode(ename)
87 if evalue is not None:
87 if evalue is not None:
88 output.evalue = unicode(evalue)
88 output.evalue = unicode(evalue)
89 if traceback is not None:
89 if traceback is not None:
@@ -85,7 +85,7 b' ws.cells.append(new_code_cell('
85 output_javascript=u'var i=0;'
85 output_javascript=u'var i=0;'
86 ),new_output(
86 ),new_output(
87 output_type=u'pyerr',
87 output_type=u'pyerr',
88 etype=u'NameError',
88 ename=u'NameError',
89 evalue=u'NameError was here',
89 evalue=u'NameError was here',
90 traceback=[u'frame 0', u'frame 1', u'frame 2']
90 traceback=[u'frame 0', u'frame 1', u'frame 2']
91 ),new_output(
91 ),new_output(
@@ -29,11 +29,11 b' class TestCell(TestCase):'
29 self.assertEqual(cc.collapsed, True)
29 self.assertEqual(cc.collapsed, True)
30
30
31 def test_pyerr(self):
31 def test_pyerr(self):
32 o = new_output(output_type=u'pyerr', etype=u'NameError',
32 o = new_output(output_type=u'pyerr', ename=u'NameError',
33 evalue=u'Name not found', traceback=[u'frame 0', u'frame 1', u'frame 2']
33 evalue=u'Name not found', traceback=[u'frame 0', u'frame 1', u'frame 2']
34 )
34 )
35 self.assertEqual(o.output_type, u'pyerr')
35 self.assertEqual(o.output_type, u'pyerr')
36 self.assertEqual(o.etype, u'NameError')
36 self.assertEqual(o.ename, u'NameError')
37 self.assertEqual(o.evalue, u'Name not found')
37 self.assertEqual(o.evalue, u'Name not found')
38 self.assertEqual(o.traceback, [u'frame 0', u'frame 1', u'frame 2'])
38 self.assertEqual(o.traceback, [u'frame 0', u'frame 1', u'frame 2'])
39
39
@@ -949,7 +949,7 b' Message type: ``crash``::'
949
949
950 content = {
950 content = {
951 # Similarly to the 'error' case for execute_reply messages, this will
951 # Similarly to the 'error' case for execute_reply messages, this will
952 # contain ename, etype and traceback fields.
952 # contain ename, evalue and traceback fields.
953
953
954 # An additional field with supplementary information such as where to
954 # An additional field with supplementary information such as where to
955 # send the crash message
955 # send the crash message
General Comments 0
You need to be logged in to leave comments. Login now