Skip to content

Commit

Permalink
Testing: Remove setting CONF_SECTION for EditorStack/EditorSplitter
Browse files Browse the repository at this point in the history
That was introducing an error in test_shortcut_for_widget_is_updated
when run on CI due to the incorrectly named section.
  • Loading branch information
ccordoba12 committed Nov 20, 2024
1 parent 6df872d commit b96d31b
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 9 deletions.
6 changes: 6 additions & 0 deletions spyder/plugins/editor/widgets/editorstack/editorstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ class EditorStackMenuSections:


class EditorStack(QWidget, SpyderWidgetMixin):

# This is necessary for the EditorStack tests to run independently of the
# Editor plugin.
CONF_SECTION = "editor"

# Signals
reset_statusbar = Signal()
readonly_changed = Signal(bool)
encoding_changed = Signal(str)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@


def editor_factory(new_file=True, text=None):
EditorStack.CONF_SECTION = "Editor"
editorstack = EditorStack(None, [], False)
editorstack.set_find_widget(FindReplace(editorstack))
editorstack.set_io_actions(Mock(), Mock(), Mock(), Mock())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
# =============================================================================
@pytest.fixture
def base_editor_bot(qtbot):
EditorStack.CONF_SECTION = "Editor"
editor_stack = EditorStack(None, [], False)
editor_stack.set_find_widget(Mock())
editor_stack.set_io_actions(Mock(), Mock(), Mock(), Mock())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def test_files(tmpdir_factory):
@pytest.fixture
def editorstack(qtbot, outlineexplorer):
def _create_editorstack(files):
EditorStack.CONF_SECTION = "Editor"
editorstack = EditorStack(None, [], False)
editorstack.set_find_widget(Mock())
editorstack.set_io_actions(Mock(), Mock(), Mock(), Mock())
Expand Down
2 changes: 0 additions & 2 deletions spyder/plugins/editor/widgets/editorstack/tests/test_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def add_files(editorstack):
# ---- Qt Test Fixtures
@pytest.fixture
def base_editor_bot(qtbot):
EditorStack.CONF_SECTION = "Editor"
editor_stack = EditorStack(None, [], False)
editor_stack.set_find_widget(Mock())
editor_stack.set_io_actions(Mock(), Mock(), Mock(), Mock())
Expand All @@ -78,7 +77,6 @@ def editor_bot(base_editor_bot, request):
@pytest.fixture
def editor_splitter_bot(qtbot):
"""Create editor splitter."""
EditorSplitter.CONF_SECTION = "Editor"
main_widget = Mock(wraps=EditorMainWidgetExample())
es = EditorSplitter(None, main_widget, [], first=True)
qtbot.addWidget(es)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def editorstack(qtbot):
Set up EditorStack with CodeEditors containing some Python code.
The cursor is at the empty line below the code.
"""
EditorStack.CONF_SECTION = "Editor"
editorstack = EditorStack(None, [], False)
editorstack.set_find_widget(Mock())
editorstack.set_io_actions(Mock(), Mock(), Mock(), Mock())
Expand Down
3 changes: 0 additions & 3 deletions spyder/plugins/editor/widgets/tests/test_editorsplitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
# ---- Qt Test Fixtures

def editor_stack():
EditorStack.CONF_SECTION = "Editor"
editor_stack = EditorStack(None, [], False)
editor_stack.set_find_widget(Mock())
editor_stack.set_io_actions(Mock(), Mock(), Mock(), Mock())
Expand All @@ -39,7 +38,6 @@ def editor_stack():
@pytest.fixture
def editor_splitter_bot(qtbot):
"""Create editor splitter."""
EditorSplitter.CONF_SECTION = "Editor"
main_widget = Mock(wraps=EditorMainWidgetExample())
es = EditorSplitter(None, main_widget, [], first=True)
qtbot.addWidget(es)
Expand Down Expand Up @@ -83,7 +81,6 @@ def clone(editorstack, template=None):
editorstack.new('test.py', 'utf-8', text)

mock_main_widget = Mock(wraps=EditorMainWidgetExample())
EditorSplitter.CONF_SECTION = "Editor"
editorsplitter = EditorSplitter(
None,
mock_main_widget,
Expand Down

0 comments on commit b96d31b

Please sign in to comment.