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: Split "test_mainwindow.test_help" and skip tests on Windows CI because they are timing out. #7792

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
32 changes: 17 additions & 15 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,26 +266,20 @@ def test_filter_numpy_warning(main_window, qtbot):

@pytest.mark.slow
@flaky(max_runs=3)
@pytest.mark.skipif(os.name == 'nt' and not PY2,
reason="Times out on AppVeyor and fails on PY3")
@pytest.mark.skipif(os.name == 'nt' and os.environ.get('CI') is not None,
reason="Times out on AppVeyor")
@pytest.mark.use_introspection
def test_get_help(main_window, qtbot):
"""
Test that Help works when called from the Editor and the IPython console.
"""
def test_get_help_ipython_console(main_window, qtbot):
"""Test that Help works when called from the IPython console."""
shell = main_window.ipyconsole.get_current_shellwidget()
control = shell._control
qtbot.waitUntil(lambda: shell._prompt_html is not None,
timeout=SHELL_TIMEOUT)

help_plugin = main_window.help
webview = help_plugin.rich_text.webview._webview
if WEBENGINE:
webpage = webview.page()
else:
webpage = webview.page().mainFrame()
webpage = webview.page() if WEBENGINE else webview.page().mainFrame()

# --- From the console ---
# Write some object in the console
qtbot.keyClicks(control, 'runfile')

Expand All @@ -295,8 +289,18 @@ def test_get_help(main_window, qtbot):
# Check that a expected text is part of the page
qtbot.waitUntil(lambda: check_text(webpage, "namespace"), timeout=6000)

# --- From the editor ---
qtbot.wait(3000)

@pytest.mark.slow
@flaky(max_runs=3)
@pytest.mark.skipif(os.name == 'nt' and os.environ.get('CI') is not None,
reason="Times out on AppVeyor")
@pytest.mark.use_introspection
def test_get_help_editor(main_window, qtbot):
""" Test that Help works when called from the Editor."""
help_plugin = main_window.help
webview = help_plugin.rich_text.webview._webview
webpage = webview.page() if WEBENGINE else webview.page().mainFrame()

# config_status = main_window.lspmanager.clients['python']['status']
# if config_status == main_window.lspmanager.RUNNING:
# main_window.lspmanager.close_client('python')
Expand All @@ -308,7 +312,6 @@ def test_get_help(main_window, qtbot):
with qtbot.waitSignal(code_editor.lsp_response_signal, timeout=30000):
code_editor.document_did_open()


# Write some object in the editor
code_editor.set_text('range')
code_editor.move_cursor(len('range'))
Expand All @@ -319,7 +322,6 @@ def test_get_help(main_window, qtbot):
with qtbot.waitSignal(code_editor.sig_display_signature, timeout=30000):
editorstack.inspect_current_object()


# Check that a expected text is part of the page
qtbot.waitUntil(lambda: check_text(webpage, "range"), timeout=30000)

Expand Down
6 changes: 4 additions & 2 deletions spyder/plugins/editor/widgets/tests/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def construct_editor(qtbot, *args, **kwargs):
lsp_manager.closing_plugin()


@pytest.mark.skipif(os.name == 'nt' and not PY2,
reason="Times out on AppVeyor and fails on PY3/PyQt 5.6")
@pytest.mark.skipif(os.name == 'nt' and os.environ.get('CI') is not None,
reason="Times out on AppVeyor")
def test_adding_warnings(qtbot, construct_editor):
"""Test that warning are saved in the blocks of the editor."""
editor, lsp_manager = construct_editor
Expand All @@ -102,6 +102,8 @@ def test_adding_warnings(qtbot, construct_editor):
# assert expected in warning


@pytest.mark.skipif(os.name == 'nt' and os.environ.get('CI') is not None,
reason="Times out on AppVeyor")
def test_move_warnings(qtbot, construct_editor):
editor, lsp_manager = construct_editor

Expand Down