bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26054)

This commit is contained in:
Mark Shannon 2021-05-12 11:25:44 +01:00 committed by GitHub
parent 6574334a68
commit cb6f3d7163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2995 additions and 2944 deletions

View file

@ -976,6 +976,26 @@ class TraceTestCase(unittest.TestCase):
(3, 'return'),
(1, 'return')])
def test_try_in_try(self):
def func():
try:
try:
pass
except Exception as ex:
pass
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')])
class SkipLineEventsTraceTestCase(TraceTestCase):
"""Repeat the trace tests, but with per-line events skipped"""
@ -1647,6 +1667,7 @@ class JumpTestCase(unittest.TestCase):
output.append(1)
async for i in asynciter([1, 2]):
output.append(3)
pass
@jump_test(3, 2, [2, 2], (ValueError, 'into'))
def test_no_jump_backwards_into_for_block(output):