[Python-checkins] python/dist/src/Lib/test test_trace.py,1.12,1.13
arigo at users.sourceforge.net
arigo at users.sourceforge.net
Mon Mar 22 14:30:41 EST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2636
Modified Files:
test_trace.py
Log Message:
The fix in ceval.c 2.386 allows iteration-by-iteration line tracing even in
single-line loops.
Index: test_trace.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_trace.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_trace.py 22 Mar 2004 19:23:46 -0000 1.12
--- test_trace.py 22 Mar 2004 19:30:39 -0000 1.13
***************
*** 166,169 ****
--- 166,190 ----
(7, 'return')]
+ def tighterloop_example():
+ items = range(1, 4)
+ try:
+ i = 0
+ while 1: i = items[i]
+ except IndexError:
+ pass
+
+ tighterloop_example.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (4, 'line'),
+ (4, 'line'),
+ (4, 'line'),
+ (4, 'line'),
+ (4, 'exception'),
+ (5, 'line'),
+ (6, 'line'),
+ (6, 'return')]
+
class Tracer:
def __init__(self):
***************
*** 221,224 ****
--- 242,247 ----
def test_11_tightloop(self):
self.run_test(tightloop_example)
+ def test_12_tighterloop(self):
+ self.run_test(tighterloop_example)
class RaisingTraceFuncTestCase(unittest.TestCase):
More information about the Python-checkins
mailing list