summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r--Lib/test/test_sys_settrace.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index f257809..37013e5 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -646,6 +646,32 @@ class TraceTestCase(unittest.TestCase):
(6, 'line'),
(6, 'return')])
+ def test_nested_loops(self):
+
+ def func():
+ for i in range(2):
+ for j in range(2):
+ a = i + j
+ return a == 1
+
+ self.run_and_compare(func,
+ [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (2, 'line'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (2, 'line'),
+ (1, 'line'),
+ (4, 'line'),
+ (4, 'return')])
+
class SkipLineEventsTraceTestCase(TraceTestCase):
"""Repeat the trace tests, but with per-line events skipped"""