##// END OF EJS Templates
drop testing on LPy
Matthias Bussonnier -
Show More
@@ -229,43 +229,44 b' except Exception:'
229 229 #----------------------------------------------------------------------------
230 230
231 231 # module testing (minimal)
232 def test_handlers():
233 def spam(c, d_e):
234 (d, e) = d_e
235 x = c + d
236 y = c * d
237 foo(x, y)
238
239 def foo(a, b, bar=1):
240 eggs(a, b + bar)
241
242 def eggs(f, g, z=globals()):
243 h = f + g
244 i = f - g
245 return h / i
246
247 buff = io.StringIO()
248
249 buff.write(u'')
250 buff.write(u'*** Before ***')
251 try:
252 buff.write(spam(1, (2, 3)))
253 except:
254 traceback.print_exc(file=buff)
255
256 handler = ColorTB(ostream=buff)
257 buff.write(u'*** ColorTB ***')
258 try:
259 buff.write(spam(1, (2, 3)))
260 except:
261 handler(*sys.exc_info())
262 buff.write(u'')
263
264 handler = VerboseTB(ostream=buff)
265 buff.write(u'*** VerboseTB ***')
266 try:
267 buff.write(spam(1, (2, 3)))
268 except:
269 handler(*sys.exc_info())
270 buff.write(u'')
232 if sys.version_info > (3,):
233 def test_handlers():
234 def spam(c, d_e):
235 (d, e) = d_e
236 x = c + d
237 y = c * d
238 foo(x, y)
239
240 def foo(a, b, bar=1):
241 eggs(a, b + bar)
242
243 def eggs(f, g, z=globals()):
244 h = f + g
245 i = f - g
246 return h / i
247
248 buff = io.StringIO()
249
250 buff.write('')
251 buff.write('*** Before ***')
252 try:
253 buff.write(spam(1, (2, 3)))
254 except:
255 traceback.print_exc(file=buff)
256
257 handler = ColorTB(ostream=buff)
258 buff.write('*** ColorTB ***')
259 try:
260 buff.write(spam(1, (2, 3)))
261 except:
262 handler(*sys.exc_info())
263 buff.write('')
264
265 handler = VerboseTB(ostream=buff)
266 buff.write('*** VerboseTB ***')
267 try:
268 buff.write(spam(1, (2, 3)))
269 except:
270 handler(*sys.exc_info())
271 buff.write('')
271 272
General Comments 0
You need to be logged in to leave comments. Login now