Skip to content

Commit e81c2fd

Browse files
committed
Update test_sys_settrace from CPython 3.10.5
1 parent 5f1b47b commit e81c2fd

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

Lib/test/test_sys_settrace.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,54 @@ def gen():
22582258
yield 3
22592259
next(gen())
22602260
output.append(5)
2261+
2262+
@jump_test(2, 3, [1, 3])
2263+
def test_jump_forward_over_listcomp(output):
2264+
output.append(1)
2265+
x = [i for i in range(10)]
2266+
output.append(3)
2267+
2268+
# checking for segfaults.
2269+
# See https://github.com/python/cpython/issues/92311
2270+
@jump_test(3, 1, [])
2271+
def test_jump_backward_over_listcomp(output):
2272+
a = 1
2273+
x = [i for i in range(10)]
2274+
c = 3
2275+
2276+
@jump_test(8, 2, [2, 7, 2])
2277+
def test_jump_backward_over_listcomp_v2(output):
2278+
flag = False
2279+
output.append(2)
2280+
if flag:
2281+
return
2282+
x = [i for i in range(5)]
2283+
flag = 6
2284+
output.append(7)
2285+
output.append(8)
2286+
2287+
@async_jump_test(2, 3, [1, 3])
2288+
async def test_jump_forward_over_async_listcomp(output):
2289+
output.append(1)
2290+
x = [i async for i in asynciter(range(10))]
2291+
output.append(3)
2292+
2293+
@async_jump_test(3, 1, [])
2294+
async def test_jump_backward_over_async_listcomp(output):
2295+
a = 1
2296+
x = [i async for i in asynciter(range(10))]
2297+
c = 3
2298+
2299+
@async_jump_test(8, 2, [2, 7, 2])
2300+
async def test_jump_backward_over_async_listcomp_v2(output):
2301+
flag = False
2302+
output.append(2)
2303+
if flag:
2304+
return
2305+
x = [i async for i in asynciter(range(5))]
2306+
flag = 6
2307+
output.append(7)
2308+
output.append(8)
22612309

22622310

22632311
if __name__ == "__main__":

0 commit comments

Comments
 (0)