summaryrefslogtreecommitdiff
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-07-16 11:49:10 +0100
committerGitHub <noreply@github.com>2021-07-16 11:49:10 +0100
commit37686f78ccef5f1cf4776419a4270cf0ea7eadf0 (patch)
tree298bb69cdc91771ff31ceeb4e13dfc3a23ca14a9 /Lib/test/test_sys_settrace.py
parent0e349ea5541104c76cafc173bfcfef8de872f96f (diff)
downloadcpython-git-37686f78ccef5f1cf4776419a4270cf0ea7eadf0.tar.gz
bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138) (GH-27182)
(cherry picked from commit a86f7dae0acf918d54086cb85e5a0b0bedeedce7)
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r--Lib/test/test_sys_settrace.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index adbb5b56dc..213c88b404 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -986,14 +986,29 @@ class TraceTestCase(unittest.TestCase):
except Exception:
pass
- # This doesn't conform to PEP 626
self.run_and_compare(func,
[(0, 'call'),
(1, 'line'),
(2, 'line'),
(3, 'line'),
- (5, 'line'),
- (5, 'return')])
+ (3, 'return')])
+
+ def test_if_in_if_in_if(self):
+ def func(a=0, p=1, z=1):
+ if p:
+ if a:
+ if z:
+ pass
+ else:
+ pass
+ else:
+ pass
+
+ self.run_and_compare(func,
+ [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (2, 'return')])
def test_early_exit_with(self):