##// 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 65 ZeroDivisionError Traceback (most recent call last)
66 66 <BLANKLINE>
67 67 ... in <module>
68 29 except IndexError:
68 69 30 mode = 'div'
69 31
70 70 ---> 32 bar(mode)
71 71 <BLANKLINE>
72 72 ... in bar(mode)
@@ -80,8 +80,6 b' ZeroDivisionError Traceback (most recent call last)'
80 80 6 x = 1
81 81 7 y = 0
82 82 ----> 8 x/y
83 9
84 10 def sysexit(stat, mode):
85 83 <BLANKLINE>
86 84 ZeroDivisionError: ...
87 85 """
@@ -97,17 +95,15 b' In [6]: run simpleerr.py'
97 95 ZeroDivisionError Traceback (most recent call last)
98 96 <BLANKLINE>
99 97 ... in <module>
98 29 except IndexError:
100 99 30 mode = 'div'
101 31
102 100 ---> 32 bar(mode)
103 global bar = <function bar at ...>
104 global mode = 'div'
101 mode = 'div'
105 102 <BLANKLINE>
106 103 ... in bar(mode='div')
107 104 14 "bar"
108 105 15 if mode=='div':
109 106 ---> 16 div0()
110 global div0 = <function div0 at ...>
111 107 17 elif mode=='exit':
112 108 18 try:
113 109 <BLANKLINE>
@@ -117,8 +113,6 b' ZeroDivisionError Traceback (most recent call last)'
117 113 ----> 8 x/y
118 114 x = 1
119 115 y = 0
120 9
121 10 def sysexit(stat, mode):
122 116 <BLANKLINE>
123 117 ZeroDivisionError: ...
124 118 """
@@ -154,8 +148,8 b' In [22]: %tb'
154 148 SystemExit Traceback (most recent call last)
155 149 <BLANKLINE>
156 150 ...<module>
151 29 except IndexError:
157 152 30 mode = 'div'
158 31
159 153 ---> 32 bar(mode)
160 154 <BLANKLINE>
161 155 ...bar(mode)
@@ -166,11 +160,8 b' SystemExit Traceback (most recent call last)'
166 160 24 raise ValueError('Unknown mode')
167 161 <BLANKLINE>
168 162 ...sysexit(stat, mode)
169 9
170 163 10 def sysexit(stat, mode):
171 164 ---> 11 raise SystemExit(stat, 'Mode = %s' % mode)
172 12
173 13 def bar(mode):
174 165 <BLANKLINE>
175 166 SystemExit: (2, 'Mode = exit')
176 167
@@ -646,7 +646,7 b' class VerboseTB(TBTools):'
646 646 lvals_list = []
647 647 if self.include_vars:
648 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 650 if lvals_list:
651 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