[Python-checkins] python/dist/src/Lib/test test_trace.py,1.10,1.11

mondragon at users.sourceforge.net mondragon at users.sourceforge.net
Mon Mar 22 14:21:49 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv667

Modified Files:
	test_trace.py 
Log Message:
Test for tight loop line event fix, SF bug #765624


Index: test_trace.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_trace.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** test_trace.py	22 Mar 2004 18:30:42 -0000	1.10
--- test_trace.py	22 Mar 2004 19:21:47 -0000	1.11
***************
*** 142,145 ****
--- 142,168 ----
                            (4, 'return')]
  
+ # Tight loop with while(1) example (SF #765624)
+ def tightloop_example():
+     items = range(0, 3)
+     try:
+         i = 0
+         while 1:
+             print items[i]; i+=1
+     except IndexError:
+         pass
+ 
+ tightloop_example.events = [(0, 'call'),
+                             (1, 'line'),
+                             (2, 'line'),
+                             (3, 'line'),
+                             (4, 'line'),
+                             (5, 'line'),
+                             (5, 'line'),
+                             (5, 'line'),
+                             (5, 'exception'),
+                             (6, 'line'),
+                             (7, 'line'),
+                             (7, 'return')]
+ 
  class Tracer:
      def __init__(self):
***************
*** 195,198 ****
--- 218,223 ----
      def test_10_ireturn(self):
          self.run_test(ireturn_example)
+     def test_11_tightloop(self):
+         self.run_test(tightloop_example)
  
  class RaisingTraceFuncTestCase(unittest.TestCase):




More information about the Python-checkins mailing list