aboutsummaryrefslogtreecommitdiffstatshomepage
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.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index 8b6631879fb..3fe0bb7f460 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -894,6 +894,29 @@ class TraceTestCase(unittest.TestCase):
(4, 'line'),
(4, 'return')])
+ def test_nested_ifs_with_and(self):
+
+ def func():
+ if A:
+ if B:
+ if C:
+ if D:
+ return False
+ else:
+ return False
+ elif E and F:
+ return True
+
+ A = B = True
+ C = False
+
+ self.run_and_compare(func,
+ [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (3, 'return')])
+
def test_nested_try_if(self):
def func():