[Python-checkins] python/dist/src/Lib/test test_trace.py,1.9,1.10
mondragon at users.sourceforge.net
mondragon at users.sourceforge.net
Mon Mar 22 13:30:44 EST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21907/Lib/test
Modified Files:
test_trace.py
Log Message:
Test for lack of implicit return line event
Index: test_trace.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_trace.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_trace.py 1 May 2003 17:45:52 -0000 1.9
--- test_trace.py 22 Mar 2004 18:30:42 -0000 1.10
***************
*** 126,129 ****
--- 126,145 ----
(4, 'return')]
+ # implicit return example
+ def ireturn_example():
+ a = 5
+ b = 5
+ if a == b:
+ b = a+1
+ else:
+ pass
+
+ ireturn_example.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (4, 'line'),
+ (4, 'return')]
+
class Tracer:
def __init__(self):
***************
*** 158,180 ****
tracer.events, func.events)
! def test_1_basic(self):
self.run_test(basic)
! def test_2_arigo(self):
self.run_test(arigo_example)
! def test_3_one_instr(self):
self.run_test(one_instr_line)
! def test_4_no_pop_blocks(self):
self.run_test(no_pop_blocks)
! def test_5_no_pop_tops(self):
self.run_test(no_pop_tops)
! def test_6_call(self):
self.run_test(call)
! def test_7_raise(self):
self.run_test(test_raise)
! def test_8_settrace_and_return(self):
self.run_test2(settrace_and_return)
! def test_9_settrace_and_raise(self):
self.run_test2(settrace_and_raise)
class RaisingTraceFuncTestCase(unittest.TestCase):
--- 174,198 ----
tracer.events, func.events)
! def test_01_basic(self):
self.run_test(basic)
! def test_02_arigo(self):
self.run_test(arigo_example)
! def test_03_one_instr(self):
self.run_test(one_instr_line)
! def test_04_no_pop_blocks(self):
self.run_test(no_pop_blocks)
! def test_05_no_pop_tops(self):
self.run_test(no_pop_tops)
! def test_06_call(self):
self.run_test(call)
! def test_07_raise(self):
self.run_test(test_raise)
! def test_08_settrace_and_return(self):
self.run_test2(settrace_and_return)
! def test_09_settrace_and_raise(self):
self.run_test2(settrace_and_raise)
+ def test_10_ireturn(self):
+ self.run_test(ireturn_example)
class RaisingTraceFuncTestCase(unittest.TestCase):
More information about the Python-checkins
mailing list