diff options
author | Mark Shannon <mark@hotpy.org> | 2021-05-12 10:25:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 10:25:44 (GMT) |
commit | cb6f3d7163c611a7772da8969475e47fbdd147af (patch) | |
tree | 85d0ea5fd1157be58589158d1aaf3a6ff32b3ea0 /Lib | |
parent | 6574334a68aa324394a6fd1f855ecbad20432b1e (diff) | |
download | cpython-cb6f3d7163c611a7772da8969475e47fbdd147af.zip cpython-cb6f3d7163c611a7772da8969475e47fbdd147af.tar.gz cpython-cb6f3d7163c611a7772da8969475e47fbdd147af.tar.bz2 |
bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26054)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_sys_settrace.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index 12d4c28..5787269 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -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): |