Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Feb 3, 2022
1 parent 89c55b6 commit 558ed8f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions spyder/plugins/editor/widgets/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ def codeeditor(qtbot):
scroll_past_end=True)
widget.setup_editor(language='Python')
widget.resize(640, 480)
qtbot.addWidget(widget)
widget.show()
return widget
yield widget
widget.close()


@pytest.fixture
Expand Down
3 changes: 0 additions & 3 deletions spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ def __getattr__(self, attr):
# Set exclamation mark to True
configuration.set('ipython_console', 'pdb_use_exclamation_mark', True)

# This segfaults on macOS
if not sys.platform == "darwin":
qtbot.addWidget(window)
window.resize(640, 480)
window.show()

Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/onlinehelp/tests/test_pydocgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def pydocbrowser(qtbot):
widget.show()

with qtbot.waitSignal(widget.sig_load_finished, timeout=20000):
widget.initialize()
widget.initialize(force=True)

yield widget
widget.close()
Expand Down
8 changes: 6 additions & 2 deletions spyder/plugins/onlinehelp/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def load_history(self, history):
self.url_combo.addItems(history)

@Slot(bool)
def initialize(self, checked=True):
def initialize(self, checked=True, force=False):
"""
Start pydoc server.
Expand All @@ -323,8 +323,12 @@ def initialize(self, checked=True):
This method is connected to the `sig_toggle_view_changed` signal,
so that the first time the widget is made visible it will start
the server. Default is True.
force: bool, optional
Force a server start even if the server is running.
Default is False.
"""
if checked and self.server is None or not self.server.is_running():
if force or (checked and self.server is None
or not self.server.is_running()):
self.sig_toggle_view_changed.disconnect(self.initialize)
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.start_server()
Expand Down

0 comments on commit 558ed8f

Please sign in to comment.