Message263959
For testing, you can create a recursive scenario that terminates with an exception after a defined number of iterations:
>>> def f(counter):
... if counter:
... f(counter-1)
... else:
... raise RuntimeError
...
>>> f(3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in f
File "<stdin>", line 3, in f
File "<stdin>", line 3, in f
File "<stdin>", line 5, in f
RuntimeError
It's probably also worth checking the handling of two distinct frame repetitions by having another recursion counter that terminates itself by calling the one that terminates by raising an exception
Beyond that, https://hg.python.org/cpython/file/tip/Lib/test/test_traceback.py covers both traceback formatting implementations, so a new test case in TracebackFormatTests seems appropriate. |
|
Date |
User |
Action |
Args |
2016-04-22 05:23:55 | ncoghlan | set | recipients:
+ ncoghlan, georg.brandl, ethan.furman, Rosuav, xiang.zhang, abarry |
2016-04-22 05:23:55 | ncoghlan | set | messageid: <1461302635.09.0.0412746766523.issue26823@psf.upfronthosting.co.za> |
2016-04-22 05:23:55 | ncoghlan | link | issue26823 messages |
2016-04-22 05:23:55 | ncoghlan | create | |
|