Skip to content

Commit debacd9

Browse files
authored
gh-92886: Fixing tests that fail when running with optimizations (-O) in test_sys_settrace.py (GH-93234)
1 parent db03c80 commit debacd9

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Lib/test/test_sys_settrace.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,8 @@ def func():
834834
(5, 'line'),
835835
(6, 'line'),
836836
(7, 'line'),
837-
(10, 'line'),
838-
(13, 'line'),
839-
(13, 'return')])
837+
(10, 'line')] +
838+
([(13, 'line'), (13, 'return')] if __debug__ else [(10, 'return')]))
840839

841840
def test_continue_through_finally(self):
842841

@@ -871,9 +870,8 @@ def func():
871870
(6, 'line'),
872871
(7, 'line'),
873872
(10, 'line'),
874-
(3, 'line'),
875-
(13, 'line'),
876-
(13, 'return')])
873+
(3, 'line')] +
874+
([(13, 'line'), (13, 'return')] if __debug__ else [(3, 'return')]))
877875

878876
def test_return_through_finally(self):
879877

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixing tests that fail when running with optimizations (``-O``) in ``test_sys_settrace.py``.

0 commit comments

Comments
 (0)