Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Dec 10, 2023
1 parent 220f16b commit b93df7b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tests_python/test_debugger_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -6081,7 +6081,6 @@ def do_something():
writer.finished_ok = True


@pytest.mark.skipif(TODO_PY311, reason='Needs bytecode support in Python 3.11')
def test_step_into_target_basic(case_setup_dap):
with case_setup_dap.test_file('_debugger_case_smart_step_into.py') as writer:
json_facade = JsonFacade(writer)
Expand All @@ -6096,8 +6095,13 @@ def test_step_into_target_basic(case_setup_dap):
# : :type step_in_targets: List[StepInTarget]
step_in_targets = json_facade.get_step_in_targets(hit.frame_id)
label_to_id = dict((target['label'], target['id']) for target in step_in_targets)
assert set(label_to_id.keys()) == {'bar', 'foo', 'call_outer'}
json_facade.write_step_in(hit.thread_id, target_id=label_to_id['foo'])
if IS_PY311_OR_GREATER:
assert set(label_to_id.keys()) == {'call_outer(foo(bar()))', 'foo(bar())', 'bar()'}
target = 'foo(bar())'
else:
assert set(label_to_id.keys()) == {'bar', 'foo', 'call_outer'}
target = 'foo'
json_facade.write_step_in(hit.thread_id, target_id=label_to_id[target])

on_foo_mark_line = writer.get_line_index_with_content('on foo mark')
hit = json_facade.wait_for_thread_stopped(reason='step', line=on_foo_mark_line)
Expand All @@ -6106,7 +6110,6 @@ def test_step_into_target_basic(case_setup_dap):
writer.finished_ok = True


@pytest.mark.skipif(TODO_PY311, reason='Needs bytecode support in Python 3.11')
def test_step_into_target_multiple(case_setup_dap):
with case_setup_dap.test_file('_debugger_case_smart_step_into2.py') as writer:
json_facade = JsonFacade(writer)
Expand All @@ -6121,8 +6124,13 @@ def test_step_into_target_multiple(case_setup_dap):
# : :type step_in_targets: List[StepInTarget]
step_in_targets = json_facade.get_step_in_targets(hit.frame_id)
label_to_id = dict((target['label'], target['id']) for target in step_in_targets)
assert set(label_to_id.keys()) == {'foo', 'foo (call 2)', 'foo (call 3)', 'foo (call 4)'}
json_facade.write_step_in(hit.thread_id, target_id=label_to_id['foo (call 2)'])
if IS_PY311_OR_GREATER:
assert set(label_to_id.keys()) == {'foo(foo(foo(foo(1))))', 'foo(foo(foo(1)))', 'foo(foo(1))', 'foo(1)'}
target = 'foo(foo(1))'
else:
assert set(label_to_id.keys()) == {'foo', 'foo (call 2)', 'foo (call 3)', 'foo (call 4)'}
target = 'foo (call 2)'
json_facade.write_step_in(hit.thread_id, target_id=label_to_id[target])

on_foo_mark_line = writer.get_line_index_with_content('on foo mark')
hit = json_facade.wait_for_thread_stopped(reason='step', line=on_foo_mark_line)
Expand Down

0 comments on commit b93df7b

Please sign in to comment.