Skip to content

Commit 85f326b

Browse files
committed
test_sys_settrace
1 parent 4f6ee95 commit 85f326b

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

Lib/test/test_sys_settrace.py

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -920,20 +920,28 @@ def test_try_except_with_wrong_type(self):
920920

921921
def func():
922922
try:
923-
2/0
924-
except IndexError:
925-
4
926-
finally:
927-
return 6
923+
try:
924+
2/0
925+
except IndexError:
926+
5
927+
finally:
928+
7
929+
except:
930+
pass
931+
return 10
928932

929933
self.run_and_compare(func,
930934
[(0, 'call'),
931935
(1, 'line'),
932936
(2, 'line'),
933-
(2, 'exception'),
934937
(3, 'line'),
935-
(6, 'line'),
936-
(6, 'return')])
938+
(3, 'exception'),
939+
(4, 'line'),
940+
(7, 'line'),
941+
(8, 'line'),
942+
(9, 'line'),
943+
(10, 'line'),
944+
(10, 'return')])
937945

938946
def test_finally_with_conditional(self):
939947

@@ -2228,21 +2236,6 @@ def test_jump_in_nested_finally_3(output):
22282236
output.append(11)
22292237
output.append(12)
22302238

2231-
@jump_test(5, 11, [2, 4], (ValueError, 'comes after the current code block'))
2232-
def test_no_jump_over_return_try_finally_in_finally_block(output):
2233-
try:
2234-
output.append(2)
2235-
finally:
2236-
output.append(4)
2237-
output.append(5)
2238-
return
2239-
try:
2240-
output.append(8)
2241-
finally:
2242-
output.append(10)
2243-
pass
2244-
output.append(12)
2245-
22462239
@jump_test(3, 4, [1], (ValueError, 'after'))
22472240
def test_no_jump_infinite_while_loop(output):
22482241
output.append(1)
@@ -2766,7 +2759,7 @@ def test_no_jump_over_return_out_of_finally_block(output):
27662759
finally:
27672760
output.append(4)
27682761
output.append(5)
2769-
return
2762+
return
27702763
output.append(7)
27712764

27722765
@jump_test(7, 4, [1, 6], (ValueError, 'into'))

0 commit comments

Comments
 (0)