@@ -948,8 +948,8 @@ def test_jump_in_nested_finally_3(output):
948
948
output .append (11 )
949
949
output .append (12 )
950
950
951
- @jump_test (5 , 11 , [2 , 4 , 12 ] )
952
- def test_jump_over_return_try_finally_in_finally_block (output ):
951
+ @jump_test (5 , 11 , [2 , 4 ], ( ValueError , 'unreachable' ) )
952
+ def test_no_jump_over_return_try_finally_in_finally_block (output ):
953
953
try :
954
954
output .append (2 )
955
955
finally :
@@ -963,8 +963,8 @@ def test_jump_over_return_try_finally_in_finally_block(output):
963
963
pass
964
964
output .append (12 )
965
965
966
- @jump_test (3 , 4 , [1 , 4 ] )
967
- def test_jump_infinite_while_loop (output ):
966
+ @jump_test (3 , 4 , [1 ], ( ValueError , 'unreachable' ) )
967
+ def test_no_jump_infinite_while_loop (output ):
968
968
output .append (1 )
969
969
while True :
970
970
output .append (3 )
@@ -1357,16 +1357,16 @@ def test_no_jump_between_except_blocks_2(output):
1357
1357
output .append (7 )
1358
1358
output .append (8 )
1359
1359
1360
- @jump_test (1 , 5 , [], ( ValueError , "into a 'finally'" ) )
1361
- def test_no_jump_into_finally_block (output ):
1360
+ @jump_test (1 , 5 , [5 ] )
1361
+ def test_jump_into_finally_block (output ):
1362
1362
output .append (1 )
1363
1363
try :
1364
1364
output .append (3 )
1365
1365
finally :
1366
1366
output .append (5 )
1367
1367
1368
- @jump_test (3 , 6 , [2 , 5 , 6 ], ( ValueError , "into a 'finally'" ) )
1369
- def test_no_jump_into_finally_block_from_try_block (output ):
1368
+ @jump_test (3 , 6 , [2 , 6 , 7 ] )
1369
+ def test_jump_into_finally_block_from_try_block (output ):
1370
1370
try :
1371
1371
output .append (2 )
1372
1372
output .append (3 )
@@ -1375,8 +1375,8 @@ def test_no_jump_into_finally_block_from_try_block(output):
1375
1375
output .append (6 )
1376
1376
output .append (7 )
1377
1377
1378
- @jump_test (5 , 1 , [1 , 3 ], ( ValueError , "out of a 'finally'" ) )
1379
- def test_no_jump_out_of_finally_block (output ):
1378
+ @jump_test (5 , 1 , [1 , 3 , 1 , 3 , 5 ] )
1379
+ def test_jump_out_of_finally_block (output ):
1380
1380
output .append (1 )
1381
1381
try :
1382
1382
output .append (3 )
@@ -1441,23 +1441,23 @@ def test_no_jump_out_of_qualified_except_block(output):
1441
1441
output .append (6 )
1442
1442
output .append (7 )
1443
1443
1444
- @jump_test (3 , 5 , [1 , 2 , - 2 ], ( ValueError , 'into' ) )
1445
- def test_no_jump_between_with_blocks (output ):
1444
+ @jump_test (3 , 5 , [1 , 2 , 5 , - 2 ])
1445
+ def test_jump_between_with_blocks (output ):
1446
1446
output .append (1 )
1447
1447
with tracecontext (output , 2 ):
1448
1448
output .append (3 )
1449
1449
with tracecontext (output , 4 ):
1450
1450
output .append (5 )
1451
1451
1452
- @async_jump_test (3 , 5 , [1 , 2 , - 2 ], ( ValueError , 'into' ) )
1453
- async def test_no_jump_between_async_with_blocks (output ):
1452
+ @async_jump_test (3 , 5 , [1 , 2 , 5 , - 2 ])
1453
+ async def test_jump_between_async_with_blocks (output ):
1454
1454
output .append (1 )
1455
1455
async with asynctracecontext (output , 2 ):
1456
1456
output .append (3 )
1457
1457
async with asynctracecontext (output , 4 ):
1458
1458
output .append (5 )
1459
1459
1460
- @jump_test (5 , 7 , [2 , 4 ], (ValueError , 'finally' ))
1460
+ @jump_test (5 , 7 , [2 , 4 ], (ValueError , "unreachable" ))
1461
1461
def test_no_jump_over_return_out_of_finally_block (output ):
1462
1462
try :
1463
1463
output .append (2 )
@@ -1551,9 +1551,8 @@ def test_no_jump_from_exception_event(output):
1551
1551
output .append (1 )
1552
1552
1 / 0
1553
1553
1554
- @jump_test (3 , 2 , [2 ], event = 'return' , error = (ValueError ,
1555
- "can't jump from a 'yield' statement" ))
1556
- def test_no_jump_from_yield (output ):
1554
+ @jump_test (3 , 2 , [2 , 5 ], event = 'return' )
1555
+ def test_jump_from_yield (output ):
1557
1556
def gen ():
1558
1557
output .append (2 )
1559
1558
yield 3
0 commit comments