Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Move breakpoints logic from editor plugin to debugger plugin #19208

Merged
merged 28 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test
  • Loading branch information
Quentin Peter committed Aug 29, 2022
commit 1cd058dc00282c4f24340b438771ff23d33dc0d9
38 changes: 19 additions & 19 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ def test_move_to_first_breakpoint(main_window, qtbot, debugcell):
debug_button = main_window.debug_toolbar.widgetForAction(debug_action)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# Load test file
test_file = osp.join(LOCATION, 'script.py')
Expand Down Expand Up @@ -1084,7 +1084,7 @@ def test_move_to_first_breakpoint(main_window, qtbot, debugcell):
assert shell.is_waiting_pdb_input()

# Remove breakpoint and close test file
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()
main_window.editor.close_file()


Expand Down Expand Up @@ -1579,7 +1579,7 @@ def test_set_new_breakpoints(main_window, qtbot):
lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# Load test file
test_file = osp.join(LOCATION, 'script.py')
Expand All @@ -1602,7 +1602,7 @@ def test_set_new_breakpoints(main_window, qtbot):
test_file) in control.toPlainText()

# Remove breakpoint and close test file
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()
main_window.editor.close_file()


Expand Down Expand Up @@ -2152,7 +2152,7 @@ def test_c_and_n_pdb_commands(main_window, qtbot):
lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# Load test file
test_file = osp.join(LOCATION, 'script.py')
Expand Down Expand Up @@ -2212,7 +2212,7 @@ def test_c_and_n_pdb_commands(main_window, qtbot):
assert 'In [2]:' in control.toPlainText()

# Remove breakpoint and close test file
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()
main_window.editor.close_file()


Expand All @@ -2228,7 +2228,7 @@ def test_stop_dbg(main_window, qtbot):
lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# Load test file
test_file = osp.join(LOCATION, 'script.py')
Expand All @@ -2252,7 +2252,7 @@ def test_stop_dbg(main_window, qtbot):
assert shell._control.toPlainText().count('IPdb') == 2

# Remove breakpoint and close test file
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()
main_window.editor.close_file()


Expand Down Expand Up @@ -3020,7 +3020,7 @@ def test_break_while_running(main_window, qtbot, tmpdir):
code_editor = main_window.editor.get_focus_widget()

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# Click the debug button
with qtbot.waitSignal(shell.executed):
Expand All @@ -3042,7 +3042,7 @@ def test_break_while_running(main_window, qtbot, tmpdir):
qtbot.keyClick(shell._control, Qt.Key_Enter)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()


# --- Preferences
Expand Down Expand Up @@ -3426,7 +3426,7 @@ def test_debug_unsaved_file(main_window, qtbot):
debug_button = main_window.debug_toolbar.widgetForAction(debug_action)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# create new file
main_window.editor.new()
Expand Down Expand Up @@ -3724,7 +3724,7 @@ def test_runcell_pdb(main_window, qtbot):
debug_button = main_window.debug_toolbar.widgetForAction(debug_action)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# create new file
main_window.editor.new()
Expand Down Expand Up @@ -4098,7 +4098,7 @@ def test_running_namespace(main_window, qtbot, tmpdir):
debug_button = main_window.debug_toolbar.widgetForAction(debug_action)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# create new file
main_window.editor.new()
Expand Down Expand Up @@ -4161,7 +4161,7 @@ def test_running_namespace_refresh(main_window, qtbot, tmpdir):
timeout=SHELL_TIMEOUT)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

shell.execute(
"runfile(" + repr(str(file2)) + ")"
Expand Down Expand Up @@ -4228,7 +4228,7 @@ def test_debug_namespace(main_window, qtbot, tmpdir):
timeout=SHELL_TIMEOUT)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

with qtbot.waitSignal(shell.executed):
shell.execute(
Expand Down Expand Up @@ -4451,7 +4451,7 @@ def hello():
debug_button = main_window.debug_toolbar.widgetForAction(debug_action)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# create new file
main_window.editor.new()
Expand Down Expand Up @@ -4751,7 +4751,7 @@ def test_prevent_closing(main_window, qtbot):
debug_button = main_window.debug_toolbar.widgetForAction(debug_action)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# create new file
main_window.editor.new()
Expand Down Expand Up @@ -4790,7 +4790,7 @@ def test_continue_first_line(main_window, qtbot):
debug_button = main_window.debug_toolbar.widgetForAction(debug_action)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# create new file
main_window.editor.new()
Expand Down Expand Up @@ -5335,7 +5335,7 @@ def test_debug_unsaved_function(main_window, qtbot):
run_button = main_window.run_toolbar.widgetForAction(run_action)

# Clear all breakpoints
main_window.editor.clear_all_breakpoints()
main_window.debugger.clear_all_breakpoints()

# create new file
main_window.editor.new()
Expand Down
1 change: 1 addition & 0 deletions spyder/plugins/editor/panels/tests/test_scrollflag.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def test_flag_painting(editor_bot, qtbot):
visible. There is seven different flags: breakpoints, todos, warnings,
errors, found_results, and occurences"""
editor = editor_bot
editor.filename = "file.py"
editor.breakpoints_manager = BreakpointsManager(editor)
sfa = editor.scrollflagarea

Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/editor/widgets/tests/test_breakpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def mark_called():
editor.sig_breakpoints_changed_called = True

editor.sig_breakpoints_changed_called = False
editor.sig_breakpoints_changed.connect(mark_called)
editor.sig_flags_changed.connect(mark_called)
text = ('def f1(a, b):\n'
'"Double quote string."\n'
'\n' # Blank line.
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/shortcuts/tests/test_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_shortcuts_filtering(shortcut_table):
assert not shortcut_table.isSortingEnabled()
# Six hits (causes a bit of an issue to hardcode it like this if new
# shortcuts are added...)
assert shortcut_table.model().rowCount() == 9
assert shortcut_table.model().rowCount() == 11
# Remove filter text
shortcut_table.finder = FilterTextMock('')
shortcut_table.set_regex()
Expand Down