@@ -1252,7 +1252,7 @@ def test_jump_out_of_block_backwards(output):
1252
1252
output .append (6 )
1253
1253
output .append (7 )
1254
1254
1255
- @async_jump_test (4 , 5 , [3 , 5 ] )
1255
+ @async_jump_test (4 , 5 , [3 ], ( ValueError , 'into' ) )
1256
1256
async def test_jump_out_of_async_for_block_forwards (output ):
1257
1257
for i in [1 ]:
1258
1258
async for i in asynciter ([1 , 2 ]):
@@ -1294,7 +1294,7 @@ def test_jump_in_nested_finally(output):
1294
1294
output .append (8 )
1295
1295
output .append (9 )
1296
1296
1297
- @jump_test (6 , 7 , [2 , 7 ], (ZeroDivisionError , '' ))
1297
+ @jump_test (6 , 7 , [2 ], (ValueError , 'within ' ))
1298
1298
def test_jump_in_nested_finally_2 (output ):
1299
1299
try :
1300
1300
output .append (2 )
@@ -1305,7 +1305,7 @@ def test_jump_in_nested_finally_2(output):
1305
1305
output .append (7 )
1306
1306
output .append (8 )
1307
1307
1308
- @jump_test (6 , 11 , [2 , 11 ], (ZeroDivisionError , '' ))
1308
+ @jump_test (6 , 11 , [2 ], (ValueError , 'within ' ))
1309
1309
def test_jump_in_nested_finally_3 (output ):
1310
1310
try :
1311
1311
output .append (2 )
@@ -1320,7 +1320,7 @@ def test_jump_in_nested_finally_3(output):
1320
1320
output .append (11 )
1321
1321
output .append (12 )
1322
1322
1323
- @jump_test (5 , 11 , [2 , 4 ], (ValueError , 'after ' ))
1323
+ @jump_test (5 , 11 , [2 , 4 ], (ValueError , 'exception ' ))
1324
1324
def test_no_jump_over_return_try_finally_in_finally_block (output ):
1325
1325
try :
1326
1326
output .append (2 )
@@ -1416,8 +1416,8 @@ def test_jump_backwards_out_of_try_except_block(output):
1416
1416
output .append (5 )
1417
1417
raise
1418
1418
1419
- @jump_test (5 , 7 , [4 , 7 , 8 ] )
1420
- def test_jump_between_except_blocks (output ):
1419
+ @jump_test (5 , 7 , [4 ], ( ValueError , 'within' ) )
1420
+ def test_no_jump_between_except_blocks (output ):
1421
1421
try :
1422
1422
1 / 0
1423
1423
except ZeroDivisionError :
@@ -1427,8 +1427,8 @@ def test_jump_between_except_blocks(output):
1427
1427
output .append (7 )
1428
1428
output .append (8 )
1429
1429
1430
- @jump_test (5 , 6 , [4 , 6 , 7 ] )
1431
- def test_jump_within_except_block (output ):
1430
+ @jump_test (5 , 6 , [4 ], ( ValueError , 'within' ) )
1431
+ def test_no_jump_within_except_block (output ):
1432
1432
try :
1433
1433
1 / 0
1434
1434
except :
@@ -1653,63 +1653,63 @@ def test_no_jump_backwards_into_for_block(output):
1653
1653
output .append (2 )
1654
1654
output .append (3 )
1655
1655
1656
- @async_jump_test (3 , 2 , [2 , 2 ], (ValueError , 'into ' ))
1656
+ @async_jump_test (3 , 2 , [2 , 2 ], (ValueError , 'within ' ))
1657
1657
async def test_no_jump_backwards_into_async_for_block (output ):
1658
1658
async for i in asynciter ([1 , 2 ]):
1659
1659
output .append (2 )
1660
1660
output .append (3 )
1661
1661
1662
- @jump_test (1 , 3 , [], (ValueError , 'into ' ))
1662
+ @jump_test (1 , 3 , [], (ValueError , 'depth ' ))
1663
1663
def test_no_jump_forwards_into_with_block (output ):
1664
1664
output .append (1 )
1665
1665
with tracecontext (output , 2 ):
1666
1666
output .append (3 )
1667
1667
1668
- @async_jump_test (1 , 3 , [], (ValueError , 'into ' ))
1668
+ @async_jump_test (1 , 3 , [], (ValueError , 'depth ' ))
1669
1669
async def test_no_jump_forwards_into_async_with_block (output ):
1670
1670
output .append (1 )
1671
1671
async with asynctracecontext (output , 2 ):
1672
1672
output .append (3 )
1673
1673
1674
- @jump_test (3 , 2 , [1 , 2 , - 1 ], (ValueError , 'into ' ))
1674
+ @jump_test (3 , 2 , [1 , 2 , - 1 ], (ValueError , 'depth ' ))
1675
1675
def test_no_jump_backwards_into_with_block (output ):
1676
1676
with tracecontext (output , 1 ):
1677
1677
output .append (2 )
1678
1678
output .append (3 )
1679
1679
1680
- @async_jump_test (3 , 2 , [1 , 2 , - 1 ], (ValueError , 'into ' ))
1680
+ @async_jump_test (3 , 2 , [1 , 2 , - 1 ], (ValueError , 'depth ' ))
1681
1681
async def test_no_jump_backwards_into_async_with_block (output ):
1682
1682
async with asynctracecontext (output , 1 ):
1683
1683
output .append (2 )
1684
1684
output .append (3 )
1685
1685
1686
- @jump_test (1 , 3 , [], ( ValueError , 'into' ) )
1687
- def test_no_jump_forwards_into_try_finally_block (output ):
1686
+ @jump_test (1 , 3 , [3 , 5 ] )
1687
+ def test_jump_forwards_into_try_finally_block (output ):
1688
1688
output .append (1 )
1689
1689
try :
1690
1690
output .append (3 )
1691
1691
finally :
1692
1692
output .append (5 )
1693
1693
1694
- @jump_test (5 , 2 , [2 , 4 ], ( ValueError , 'into' ) )
1695
- def test_no_jump_backwards_into_try_finally_block (output ):
1694
+ @jump_test (5 , 2 , [2 , 4 , 2 , 4 , 5 ] )
1695
+ def test_jump_backwards_into_try_finally_block (output ):
1696
1696
try :
1697
1697
output .append (2 )
1698
1698
finally :
1699
1699
output .append (4 )
1700
1700
output .append (5 )
1701
1701
1702
- @jump_test (1 , 3 , [], ( ValueError , 'into' ) )
1703
- def test_no_jump_forwards_into_try_except_block (output ):
1702
+ @jump_test (1 , 3 , [3 ] )
1703
+ def test_jump_forwards_into_try_except_block (output ):
1704
1704
output .append (1 )
1705
1705
try :
1706
1706
output .append (3 )
1707
1707
except :
1708
1708
output .append (5 )
1709
1709
raise
1710
1710
1711
- @jump_test (6 , 2 , [2 ], ( ValueError , 'into' ) )
1712
- def test_no_jump_backwards_into_try_except_block (output ):
1711
+ @jump_test (6 , 2 , [2 , 2 , 6 ] )
1712
+ def test_jump_backwards_into_try_except_block (output ):
1713
1713
try :
1714
1714
output .append (2 )
1715
1715
except :
@@ -1718,7 +1718,7 @@ def test_no_jump_backwards_into_try_except_block(output):
1718
1718
output .append (6 )
1719
1719
1720
1720
# 'except' with a variable creates an implicit finally block
1721
- @jump_test (5 , 7 , [4 ], (ValueError , 'into ' ))
1721
+ @jump_test (5 , 7 , [4 ], (ValueError , 'within ' ))
1722
1722
def test_no_jump_between_except_blocks_2 (output ):
1723
1723
try :
1724
1724
1 / 0
@@ -1755,23 +1755,23 @@ def test_jump_out_of_finally_block(output):
1755
1755
finally :
1756
1756
output .append (5 )
1757
1757
1758
- @jump_test (1 , 5 , [], (ValueError , "into an 'except' " ))
1758
+ @jump_test (1 , 5 , [], (ValueError , "into an exception " ))
1759
1759
def test_no_jump_into_bare_except_block (output ):
1760
1760
output .append (1 )
1761
1761
try :
1762
1762
output .append (3 )
1763
1763
except :
1764
1764
output .append (5 )
1765
1765
1766
- @jump_test (1 , 5 , [], (ValueError , "into an 'except' " ))
1766
+ @jump_test (1 , 5 , [], (ValueError , "into an exception " ))
1767
1767
def test_no_jump_into_qualified_except_block (output ):
1768
1768
output .append (1 )
1769
1769
try :
1770
1770
output .append (3 )
1771
1771
except Exception :
1772
1772
output .append (5 )
1773
1773
1774
- @jump_test (3 , 6 , [2 , 5 , 6 ], (ValueError , "into an 'except' " ))
1774
+ @jump_test (3 , 6 , [2 , 5 , 6 ], (ValueError , "into an exception " ))
1775
1775
def test_no_jump_into_bare_except_block_from_try_block (output ):
1776
1776
try :
1777
1777
output .append (2 )
@@ -1782,7 +1782,7 @@ def test_no_jump_into_bare_except_block_from_try_block(output):
1782
1782
raise
1783
1783
output .append (8 )
1784
1784
1785
- @jump_test (3 , 6 , [2 ], (ValueError , "into an 'except' " ))
1785
+ @jump_test (3 , 6 , [2 ], (ValueError , "into an exception " ))
1786
1786
def test_no_jump_into_qualified_except_block_from_try_block (output ):
1787
1787
try :
1788
1788
output .append (2 )
@@ -1793,7 +1793,7 @@ def test_no_jump_into_qualified_except_block_from_try_block(output):
1793
1793
raise
1794
1794
output .append (8 )
1795
1795
1796
- @jump_test (7 , 1 , [1 , 3 , 6 ], (ValueError , "out of an 'except' " ))
1796
+ @jump_test (7 , 1 , [1 , 3 , 6 ], (ValueError , "within " ))
1797
1797
def test_no_jump_out_of_bare_except_block (output ):
1798
1798
output .append (1 )
1799
1799
try :
@@ -1803,7 +1803,7 @@ def test_no_jump_out_of_bare_except_block(output):
1803
1803
output .append (6 )
1804
1804
output .append (7 )
1805
1805
1806
- @jump_test (7 , 1 , [1 , 3 , 6 ], (ValueError , "out of an 'except' " ))
1806
+ @jump_test (7 , 1 , [1 , 3 , 6 ], (ValueError , "within " ))
1807
1807
def test_no_jump_out_of_qualified_except_block (output ):
1808
1808
output .append (1 )
1809
1809
try :
0 commit comments