##// END OF EJS Templates
Update doctests. Use repr when showing variables
Alex Hall -
Show More
@@ -65,8 +65,8 b' In [4]: run simpleerr.py'
65 ZeroDivisionError Traceback (most recent call last)
65 ZeroDivisionError Traceback (most recent call last)
66 <BLANKLINE>
66 <BLANKLINE>
67 ... in <module>
67 ... in <module>
68 29 except IndexError:
68 30 mode = 'div'
69 30 mode = 'div'
69 31
70 ---> 32 bar(mode)
70 ---> 32 bar(mode)
71 <BLANKLINE>
71 <BLANKLINE>
72 ... in bar(mode)
72 ... in bar(mode)
@@ -80,8 +80,6 b' ZeroDivisionError Traceback (most recent call last)'
80 6 x = 1
80 6 x = 1
81 7 y = 0
81 7 y = 0
82 ----> 8 x/y
82 ----> 8 x/y
83 9
84 10 def sysexit(stat, mode):
85 <BLANKLINE>
83 <BLANKLINE>
86 ZeroDivisionError: ...
84 ZeroDivisionError: ...
87 """
85 """
@@ -97,17 +95,15 b' In [6]: run simpleerr.py'
97 ZeroDivisionError Traceback (most recent call last)
95 ZeroDivisionError Traceback (most recent call last)
98 <BLANKLINE>
96 <BLANKLINE>
99 ... in <module>
97 ... in <module>
98 29 except IndexError:
100 30 mode = 'div'
99 30 mode = 'div'
101 31
102 ---> 32 bar(mode)
100 ---> 32 bar(mode)
103 global bar = <function bar at ...>
101 mode = 'div'
104 global mode = 'div'
105 <BLANKLINE>
102 <BLANKLINE>
106 ... in bar(mode='div')
103 ... in bar(mode='div')
107 14 "bar"
104 14 "bar"
108 15 if mode=='div':
105 15 if mode=='div':
109 ---> 16 div0()
106 ---> 16 div0()
110 global div0 = <function div0 at ...>
111 17 elif mode=='exit':
107 17 elif mode=='exit':
112 18 try:
108 18 try:
113 <BLANKLINE>
109 <BLANKLINE>
@@ -117,8 +113,6 b' ZeroDivisionError Traceback (most recent call last)'
117 ----> 8 x/y
113 ----> 8 x/y
118 x = 1
114 x = 1
119 y = 0
115 y = 0
120 9
121 10 def sysexit(stat, mode):
122 <BLANKLINE>
116 <BLANKLINE>
123 ZeroDivisionError: ...
117 ZeroDivisionError: ...
124 """
118 """
@@ -154,8 +148,8 b' In [22]: %tb'
154 SystemExit Traceback (most recent call last)
148 SystemExit Traceback (most recent call last)
155 <BLANKLINE>
149 <BLANKLINE>
156 ...<module>
150 ...<module>
151 29 except IndexError:
157 30 mode = 'div'
152 30 mode = 'div'
158 31
159 ---> 32 bar(mode)
153 ---> 32 bar(mode)
160 <BLANKLINE>
154 <BLANKLINE>
161 ...bar(mode)
155 ...bar(mode)
@@ -166,11 +160,8 b' SystemExit Traceback (most recent call last)'
166 24 raise ValueError('Unknown mode')
160 24 raise ValueError('Unknown mode')
167 <BLANKLINE>
161 <BLANKLINE>
168 ...sysexit(stat, mode)
162 ...sysexit(stat, mode)
169 9
170 10 def sysexit(stat, mode):
163 10 def sysexit(stat, mode):
171 ---> 11 raise SystemExit(stat, 'Mode = %s' % mode)
164 ---> 11 raise SystemExit(stat, 'Mode = %s' % mode)
172 12
173 13 def bar(mode):
174 <BLANKLINE>
165 <BLANKLINE>
175 SystemExit: (2, 'Mode = exit')
166 SystemExit: (2, 'Mode = exit')
176
167
@@ -646,7 +646,7 b' class VerboseTB(TBTools):'
646 lvals_list = []
646 lvals_list = []
647 if self.include_vars:
647 if self.include_vars:
648 for var in frame_info.variables_in_executing_piece:
648 for var in frame_info.variables_in_executing_piece:
649 lvals_list.append(tpl_name_val % (var.name, var.value))
649 lvals_list.append(tpl_name_val % (var.name, repr(var.value)))
650 if lvals_list:
650 if lvals_list:
651 lvals = '%s%s' % (indent, em_normal.join(lvals_list))
651 lvals = '%s%s' % (indent, em_normal.join(lvals_list))
652
652
General Comments 0
You need to be logged in to leave comments. Login now