From ecf2025917009b8ad6da721f4d3377a86d74fa84 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sat, 17 Nov 2018 15:23:53 -0500 Subject: [PATCH] Testing: Fix tests in Appveyor/Python 2 --- spyder/plugins/onlinehelp/tests/test_pydocgui.py | 1 - spyder/plugins/onlinehelp/widgets.py | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spyder/plugins/onlinehelp/tests/test_pydocgui.py b/spyder/plugins/onlinehelp/tests/test_pydocgui.py index b8530bc559a..23b3b795d78 100644 --- a/spyder/plugins/onlinehelp/tests/test_pydocgui.py +++ b/spyder/plugins/onlinehelp/tests/test_pydocgui.py @@ -19,7 +19,6 @@ def pydocbrowser(qtbot): """Set up pydocbrowser.""" widget = PydocBrowser(None) - widget.start_server() qtbot.addWidget(widget) return widget diff --git a/spyder/plugins/onlinehelp/widgets.py b/spyder/plugins/onlinehelp/widgets.py index e5cb9b5ae78..002110fe5e3 100644 --- a/spyder/plugins/onlinehelp/widgets.py +++ b/spyder/plugins/onlinehelp/widgets.py @@ -58,11 +58,11 @@ def completer(self): def quit_server(self): if PY3: # Python 3 - if self.server and self.server.serving: + if self.is_server_running() and self.server.serving: self.server.stop() else: # Python 2 - if self.server: + if self.is_server_running(): self.server.quit = 1 @@ -94,7 +94,8 @@ def is_server_running(self): return self.server is not None def closeEvent(self, event): - self.server.quit_server() + if self.is_server_running(): + self.server.quit_server() # while not self.server.complete: #XXX Is it really necessary? # pass event.accept()