Skip to content

Commit

Permalink
More fixes for mainwindow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Oct 5, 2023
1 parent c12120a commit 14dc366
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5445,7 +5445,7 @@ def test_func():
run_parameters = generate_run_parameters(main_window, fname)
CONF.set('run', 'last_used_parameters', run_parameters)

main_window.editor.update_run_focus_file()
main_window.editor.get_widget().update_run_focus_file()
qtbot.wait(2000)

# Click the run button
Expand Down Expand Up @@ -5636,7 +5636,7 @@ def test_debug_unsaved_function(main_window, qtbot):
run_parameters = generate_run_parameters(main_window, fname)
CONF.set('run', 'last_used_parameters', run_parameters)

main_window.editor.update_run_focus_file()
main_window.editor.get_widget().update_run_focus_file()
qtbot.wait(2000)

# Set breakpoint
Expand Down
6 changes: 6 additions & 0 deletions spyder/plugins/editor/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,12 @@ def close_file_from_name(self, *args, **kwargs):
def close_all_files(self):
return self.get_widget().close_all_files()

def go_to_line(self, *args, **kwargs):
return self.get_widget().go_to_line(*args, **kwargs)

def set_current_filename(self, *args, **kwargs):
return self.get_widget().set_current_filename(*args, **kwargs)

# ---- Private API
# ------------------------------------------------------------------------
# ---- Run related methods
Expand Down
11 changes: 6 additions & 5 deletions spyder/plugins/editor/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1487,12 +1487,13 @@ def update_source_menu(self, options, **kwargs):
named_options = dict(zip(option_names, options))
for name, action in self.checkable_actions.items():
if name in named_options:
if name == 'underline_errors':
opt = named_options[name]
section = 'editor'
completions_options = ['pycodestyle', 'pydocstyle']
if name in completions_options:
section = 'completions'
opt = 'underline_errors'
else:
section = 'editor'
opt = named_options[name]
if name == 'underline_errors':
opt = name

state = self.get_conf(opt, section=section)

Expand Down

0 comments on commit 14dc366

Please sign in to comment.