Skip to content
Snippets Groups Projects
Unverified Commit 8cf29068 authored by Dennis Sweeney's avatar Dennis Sweeney Committed by GitHub
Browse files

gh-92311: Add tests for frame_setlineno jumping over listcomps (#92741)

parent 83c0247d
No related branches found
No related tags found
No related merge requests found
...@@ -2431,6 +2431,54 @@ def gen(): ...@@ -2431,6 +2431,54 @@ def gen():
next(gen()) next(gen())
output.append(5) output.append(5)
@jump_test(2, 3, [1, 3])
def test_jump_forward_over_listcomp(output):
output.append(1)
x = [i for i in range(10)]
output.append(3)
# checking for segfaults.
# See https://github.com/python/cpython/issues/92311
@jump_test(3, 1, [])
def test_jump_backward_over_listcomp(output):
a = 1
x = [i for i in range(10)]
c = 3
@jump_test(8, 2, [2, 7, 2])
def test_jump_backward_over_listcomp_v2(output):
flag = False
output.append(2)
if flag:
return
x = [i for i in range(5)]
flag = 6
output.append(7)
output.append(8)
@async_jump_test(2, 3, [1, 3])
async def test_jump_forward_over_async_listcomp(output):
output.append(1)
x = [i async for i in asynciter(range(10))]
output.append(3)
@async_jump_test(3, 1, [])
async def test_jump_backward_over_async_listcomp(output):
a = 1
x = [i async for i in asynciter(range(10))]
c = 3
@async_jump_test(8, 2, [2, 7, 2])
async def test_jump_backward_over_async_listcomp_v2(output):
flag = False
output.append(2)
if flag:
return
x = [i async for i in asynciter(range(5))]
flag = 6
output.append(7)
output.append(8)
class TestExtendedArgs(unittest.TestCase): class TestExtendedArgs(unittest.TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment