summaryrefslogtreecommitdiff
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-12-15 11:07:50 +0000
committerGitHub <noreply@github.com>2020-12-15 11:07:50 +0000
commit8473cf89bdbf2cb292b39c972db540504669b9cd (patch)
tree68e19e5056b75e3e86d8bc13b7ac6c214fb83ea6 /Lib/test/test_sys_settrace.py
parent6f79e60b66dacefca147bdaa80eb37f936a72991 (diff)
downloadcpython-git-8473cf89bdbf2cb292b39c972db540504669b9cd.tar.gz
bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if statements conform to PEP 626. (GH-23743)
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r--Lib/test/test_sys_settrace.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index 37013e51c9..a842139cd8 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -53,9 +53,8 @@ basic.events = [(0, 'call'),
# following that clause?
-# Some constructs like "while 0:", "if 0:" or "if 1:...else:..." are optimized
-# away. No code # exists for them, so the line numbers skip directly from
-# "del x" to "x = 1".
+# Some constructs like "while 0:", "if 0:" or "if 1:...else:..." could be optimized
+# away. Make sure that those lines aren't skipped.
def arigo_example0():
x = 1
del x
@@ -66,6 +65,7 @@ def arigo_example0():
arigo_example0.events = [(0, 'call'),
(1, 'line'),
(2, 'line'),
+ (3, 'line'),
(5, 'line'),
(5, 'return')]
@@ -79,6 +79,7 @@ def arigo_example1():
arigo_example1.events = [(0, 'call'),
(1, 'line'),
(2, 'line'),
+ (3, 'line'),
(5, 'line'),
(5, 'return')]
@@ -94,6 +95,7 @@ def arigo_example2():
arigo_example2.events = [(0, 'call'),
(1, 'line'),
(2, 'line'),
+ (3, 'line'),
(4, 'line'),
(7, 'line'),
(7, 'return')]
@@ -236,9 +238,13 @@ tightloop_example.events = [(0, 'call'),
(1, 'line'),
(2, 'line'),
(3, 'line'),
+ (4, 'line'),
(5, 'line'),
+ (4, 'line'),
(5, 'line'),
+ (4, 'line'),
(5, 'line'),
+ (4, 'line'),
(5, 'line'),
(5, 'exception'),
(6, 'line'),