question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing tests with Spyder 5.3.x and Debian unstable

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Thanks all for your great work on getting 5.3.0 released! I’m pleased to say that all of the tests that were failing with 5.2.x now work. There are just a new problematic tests, and I don’t know enough to understand what is wrong. But besides these, it looks very good, so I’ll upload 5.3.0 to Debian unstable (with these tests disabled) and then submit a further issue if any of them fail on architectures other than amd64.

test_mainwindow.py segfaults

spyder/app/tests/test_mainwindow.py regularly segfaults. Here’s an example of running this test alone. (My runtests.py is a slightly modified version of the official version, introducing the --homedir option.) I don’t know whether there’s enough information here to help identify the source of the crash, though.

euler:~/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1 $ CI=true HOME=/tmp/homedir xvfb-run -a -s "-screen 0 1024x768x24 +extension GLX" python3.9 runtests.py --homedir=/tmp/homedir --run-slow -v 'spyder/app/tests/test_mainwindow.py'
Pytest Arguments: ['-vv', '-rw', '--durations=10', '-W ignore::UserWarning', '--run-slow', '-v', 'spyder/app/tests/test_mainwindow.py']
============================= test session starts ==============================
platform linux -- Python 3.9.12, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /usr/bin/python3.9
cachedir: .pytest_cache
PySide2 5.15.2 -- Qt runtime 5.15.2 -- Qt compiled 5.15.2
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/.hypothesis/examples')
rootdir: /home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1, configfile: pytest.ini
plugins: lazy-fixture-0.6.3, xdist-2.5.0, anyio-3.5.0, order-1.0.1, mock-3.6.1, forked-1.4.0, cov-3.0.0, timeout-2.1.0, qt-4.0.2, dependency-0.5.1, flaky-3.7.0, hypothesis-6.36.0
collected 108 items                                                            

spyder/app/tests/test_mainwindow.py::test_single_instance_and_edit_magic Fatal Python error: Segmentation fault

Thread 0x00007f623f7fe640 (most recent call first):
  File "/usr/lib/python3.9/threading.py", line 312 in wait
  File "/usr/lib/python3.9/threading.py", line 574 in wait
  File "/usr/lib/python3/dist-packages/IPython/core/history.py", line 829 in run
  File "/usr/lib/python3/dist-packages/IPython/core/history.py", line 60 in only_when_enabled
  File "<decorator-gen-17>", line 2 in run
  File "/usr/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 930 in _bootstrap

Thread 0x00007f626d7fa640 (most recent call first):
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/onlinehelp/pydoc_patch.py", line 938 in serve_until_quit
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/onlinehelp/pydoc_patch.py", line 967 in run
  File "/usr/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 930 in _bootstrap

Current thread 0x00007f6472393740 (most recent call first):
  File "/usr/lib/python3/dist-packages/qtconsole/console_widget.py", line 342 in __init__
  File "/usr/lib/python3/dist-packages/qtconsole/history_console_widget.py", line 27 in __init__
  File "/usr/lib/python3/dist-packages/qtconsole/frontend_widget.py", line 165 in __init__
  File "/usr/lib/python3/dist-packages/qtconsole/jupyter_widget.py", line 118 in __init__
  File "/usr/lib/python3/dist-packages/qtconsole/rich_jupyter_widget.py", line 55 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/debugging.py", line 75 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/debugging.py", line 195 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/shell.py", line 119 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/client.py", line 146 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/main_widget.py", line 1548 in create_new_client
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/plugin.py", line 521 in create_new_client
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/plugin.py", line 389 in on_mainwindow_visible
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/mainwindow.py", line 1169 in post_visible_setup
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/utils.py", line 300 in create_window
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/mainwindow.py", line 1989 in main
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/start.py", line 234 in main
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/tests/test_mainwindow.py", line 331 in main_window
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 925 in call_fixture_func
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 1126 in pytest_fixture_setup
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 1072 in execute
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 687 in _compute_fixture_value
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 601 in _get_active_fixturedef
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 581 in getfixturevalue
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 568 in _fillfixtures
  File "/usr/lib/python3/dist-packages/pytest_lazyfixture.py", line 39 in fill
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1647 in setup
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 449 in prepare
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 150 in pytest_runtest_setup
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 255 in <lambda>
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 311 in from_call
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 254 in call_runtest_hook
  File "/usr/lib/python3/dist-packages/flaky/flaky_pytest_plugin.py", line 138 in call_and_report
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 120 in runtestprotocol
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 109 in pytest_runtest_protocol
  File "/usr/lib/python3/dist-packages/flaky/flaky_pytest_plugin.py", line 94 in pytest_runtest_protocol
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 348 in pytest_runtestloop
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 323 in _main
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 269 in wrap_session
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 316 in pytest_cmdline_main
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 162 in main
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 48 in run_pytest
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 78 in main
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 82 in <module>
Segmentation fault

test_get_hints fails

spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_hints fails with all three parameters, both with Python 3.9 and Python 3.10; here’s one of the test logs:

___________________________ test_get_hints[params0] ____________________________

qtbot = <pytestqt.qtbot.QtBot object at 0x7f10c7c49a00>
completions_codeeditor = (<spyder.plugins.editor.widgets.codeeditor.CodeEditor object at 0x7f10a29a89d0>, <spyder.plugins.completion.plugin.CompletionPlugin object at 0x7f10a2cc5820>)
params = ('"".format', '-> str')
capsys = <_pytest.capture.CaptureFixture object at 0x7f10a2ef6fd0>

    @pytest.mark.slow
    @pytest.mark.order(2)
    @pytest.mark.skipif(sys.platform == 'darwin', reason='Fails on Mac')
    @pytest.mark.parametrize('params', [
            # Parameter, Expected Output
            ('"".format', '-> str'),
            ('import math', 'module'),
            (TEST_TEXT, TEST_DOCSTRING)
        ]
    )
    def test_get_hints(qtbot, completions_codeeditor, params, capsys):
        """Test that the editor is returning hover hints."""
        code_editor, _ = completions_codeeditor
        param, expected_output_text = params
    
        # Move mouse to another position to be sure the hover is displayed when
        # the cursor is put on top of the tested word.
        qtbot.mouseMove(code_editor, QPoint(400, 400))
    
        # Set text in editor
        code_editor.set_text(param)
    
        # Get cursor coordinates
        code_editor.moveCursor(QTextCursor.End)
        qtbot.keyPress(code_editor, Qt.Key_Left)
    
        # Wait a bit in case the window manager repositions the window.
        qtbot.wait(1000)
    
        # Position cursor on top of word we want the hover for.
        x, y = code_editor.get_coordinates('cursor')
        point = code_editor.calculate_real_position(QPoint(x, y))
    
        # Get hover and compare
        with qtbot.waitSignal(code_editor.sig_display_object_info,
                              timeout=30000) as blocker:
            qtbot.mouseMove(code_editor, point)
            qtbot.mouseClick(code_editor, Qt.LeftButton, pos=point)
>           qtbot.waitUntil(lambda: code_editor.tooltip_widget.isVisible(),
                            timeout=10000)
E           pytestqt.exceptions.TimeoutError: waitUntil timed out in 10000 milliseconds

spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py:171: TimeoutError

I do seem to get the expected behaviour when I perform these actions manually.

Versions

  • Spyder version: 5.3.0
  • Python version: 3.9.12 and 3.10.4
  • Qt version: 5.15.2
  • PyQt version: 5.15.6
  • Operating System name/version: Linux 5.16.0-5-amd64 (Debian unstable)

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.31.1              :  8.0.1 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.0 (OK)
jellyfish >=0.7               :  0.8.9 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.5.0 (OK)
nbconvert >=4.0               :  6.4.4 (OK)
numpydoc >=0.6.0              :  1.2.1 (OK)
parso >=0.7.0;<0.9.0          :  0.8.1 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0                :  2.12.2 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.4.1;<1.5.0          :  1.4.1 (OK)
pylsp_black >=1.2.0           :  1.2.0 (OK)
qdarkstyle >=3.0.2;<3.1.0     :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.1.1 (OK)
qtconsole >=5.3.0;<5.4.0      :  5.3.0 (OK)
qtpy >=2.0.1                  :  2.0.1 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  59.6.0 (OK)
sphinx >=0.6.6                :  4.3.2 (OK)
spyder_kernels >=2.3.0;<2.4.0 :  2.3.0 (OK)
textdistance >=4.2.0          :  4.2.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.7 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  0.29.28 (OK)
matplotlib >=3.0.0            :  3.5.1 (OK)
numpy >=1.7                   :  1.21.5 (OK)
pandas >=1.1.1                :  1.3.5 (OK)
scipy >=0.17.0                :  1.7.3 (OK)
sympy >=0.7.3                 :  1.9 (OK)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
juliangilbeycommented, Jun 3, 2022

Hi there! Here’s an update with Spyder 5.3.1 on amd64.

Things are generally better than with 5.3.0! Only two tests are still consistently failing; the first is spyder/app/tests/test_mainwindow.py::test_run_cython_code

Here is an example of it (and we still don’t have debugpy, but that seems to be unrelated):

_____________________________ test_run_cython_code _____________________________

main_window = <spyder.app.mainwindow.MainWindow object at 0x7fd754ada700>
qtbot = <pytestqt.qtbot.QtBot object at 0x7fd754d37fd0>

    @pytest.mark.slow
    @flaky(max_runs=3)
    @pytest.mark.skipif(
        (os.name == 'nt' or sys.platform == 'darwin' or
         parse_version(ipy_release.version) == parse_version('7.11.0')),
        reason="Hard to test on Windows and macOS and fails for IPython 7.11.0")
    def test_run_cython_code(main_window, qtbot):
        """Test all the different ways we have to run Cython code"""
        # ---- Setup ----
        # Get a reference to the code editor widget
        code_editor = main_window.editor.get_focus_widget()
    
        # ---- Run pyx file ----
        # Load test file
        main_window.editor.load(osp.join(LOCATION, 'pyx_script.pyx'))
    
        # Run file
        qtbot.keyClick(code_editor, Qt.Key_F5)
    
        # Get a reference to the namespace browser widget
        nsb = main_window.variableexplorer.current_widget()
    
        # Wait until an object appears
>       qtbot.waitUntil(lambda: nsb.editor.source_model.rowCount() == 1,
                        timeout=COMPILE_AND_EVAL_TIMEOUT)
E       pytestqt.exceptions.TimeoutError: waitUntil timed out in 30000 milliseconds

/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/test_mainwindow.py:1349: TimeoutError
----------------------------- Captured Qt messages -----------------------------
QtWarningMsg: Attribute Qt::AA_UseSoftwareOpenGL must be set before QCoreApplication is created.
QtWarningMsg: Scenegraph already initialized, setBackend() request ignored
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 

And the second test almost always fails: spyder/app/tests/test_mainwindow.py::test_ordering_lsp_requests_at_startup

Here is some sample output:

____________________ test_ordering_lsp_requests_at_startup _____________________

main_window = <spyder.app.mainwindow.MainWindow object at 0x7ff9d82ec280>
qtbot = <pytestqt.qtbot.QtBot object at 0x7ff948040250>

    @pytest.mark.slow
    @flaky(max_runs=3)
    @pytest.mark.use_introspection
    @pytest.mark.order(after="test_debug_unsaved_function")
    @pytest.mark.preload_project
    @pytest.mark.skipif(os.name == 'nt', reason='Times out on Windows')
    def test_ordering_lsp_requests_at_startup(main_window, qtbot):
        """
        Test the ordering of requests we send to the LSP at startup when a
        project was left open during the previous session.
    
        This is a regression test for spyder-ide/spyder#13351.
        """
        # Wait until the LSP server is up.
        code_editor = main_window.editor.get_current_editor()
        qtbot.waitSignal(code_editor.completions_response_signal, timeout=30000)
    
        # Wait until the initial requests are sent to the server.
        lsp = main_window.completions.get_provider('lsp')
        python_client = lsp.clients['python']
        qtbot.wait(5000)
    
        expected_requests = [
            'initialize',
            'initialized',
            'workspace/didChangeConfiguration',
            'workspace/didChangeWorkspaceFolders',
            'textDocument/didOpen',
        ]
    
        skip_intermediate = {
            'initialized': {'workspace/didChangeConfiguration'}
        }
    
        lsp_requests = python_client['instance']._requests
        start_idx = lsp_requests.index((0, 'initialize'))
    
        request_order = []
        expected_iter = iter(expected_requests)
        current_expected = next(expected_iter)
        for i in range(start_idx, len(lsp_requests)):
            if current_expected is None:
                break
    
            _, req_type = lsp_requests[i]
            if req_type == current_expected:
                request_order.append(req_type)
                current_expected = next(expected_iter, None)
            else:
                skip_set = skip_intermediate.get(current_expected, set({}))
                if req_type in skip_set:
                    continue
                else:
>                   assert req_type == current_expected
E                   AssertionError: assert 'textDocument/didChange' == 'textDocument/didOpen'
E                     - textDocument/didOpen
E                     ?                 ^^ -
E                     + textDocument/didChange
E                     ?                 ^^^^^

/tmp/autopkgtest-lxc.0c0pxmav/downtmp/build.gSC/src/spyder/app/tests/test_mainwindow.py:4098: AssertionError
----------------------------- Captured Qt messages -----------------------------
QtWarningMsg: Attribute Qt::AA_UseSoftwareOpenGL must be set before QCoreApplication is created.
QtWarningMsg: Scenegraph already initialized, setBackend() request ignored
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 

I’m sometimes getting segfaults in test_mainwindow.py, but as ever, these are really hard to track down. I’m also sometimes getting timeouts in our testbed system (there’s a time limit of just under 3 hours). Other than that, things seem to be doing fine.

On i386, I’m still excluding test_mainwindow.py (as it regularly segfaults) and test_ipythonconsole.py (likewise), and also spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_hints as it repeatedly fails.

Best wishes, Julian

2reactions
juliangilbeycommented, Apr 29, 2022

Hello, and sorry for the slow reply on this one. Here’s an update on this.

  • spyder/app/tests/test_mainwindow.py : I haven’t made any progress here, and am leaving it deselected for now. I ran the QtConsole test suite and it ran without any problems.
  • spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_hints: I’m just leaving this one deselected for now.
  • Flaky tests such as test_pdb_eventloop[inline]: they are indeed just flaky. I took your lead of running pytest multiple times, but used a slightly more sophisticated approach: I run pytest repeatedly until every (selected) test passes or xfails, up to a maximum of 5 times. Here’s the script I’ve written to do this; please feel free to take it! https://salsa.debian.org/science-team/spyder/-/blob/master/debian/tests/run_pytest.py
  • Debian’s CI setup runs the test suite on various architectures. It turns out that on i386 and armhf, spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py causes Python to crash. It’s not at a consistent test in this file, and sometimes Python crashes at a later test after these ones have run. I have no idea why, but I’m just skipping this file on these architectures now. I can give you parts of the logs if you would like. But as they’re not used much on desktops, I’m not sure if it’s worth the effort investigating further.
  • On armhf, there are also problems with spyder/plugins/pylint/tests/test_pylint.py::test_pylint_widget_pylintrc: this test fails with all 10 parameter options with timeouts on the qtbot.waitUntil call. Three other tests also fail:
    • spyder/plugins/editor/widgets/tests/test_completions_hide.py::test_automatic_completions_hide_complete fails repeatedly on the assertion assert completion.isHidden() - the value is False
    • spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_calltips[params0] (where params = ('dict', 'dict')) is flaky - it sometimes fails on the line: output_text = args[0]['signatures']['label'] with the error TypeError: 'NoneType' object is not subscriptable
    • spyder/plugins/editor/widgets/tests/test_introspection.py::test_automatic_completions fails on Python 3.10 at the qtbot.waitSignal call.

Best wishes, Julian

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug#1014844: python-lsp-server: breaks spyder 5.3.1 and ...
The Debian unstable version of Spyder has been patched to use the newer PyLSP version, but various failing tests had to be ignored...
Read more >
Installation of Python, Spyder, Numpy, Sympy, Scipy, Pytest ...
Running the tests from the console​​ Open a console: Windows: type cmd in the search box. Mac OS X: Start the Terminal application...
Read more >
Bugs in package python3-spyder (version 5.3.3+dfsg-3) in unstable ...
Debian Bug report logs: Bugs in package python3-spyder (version 5.3.3+dfsg-3) in unstable · Outstanding bugs -- Serious (policy violations or makes package unfit ......
Read more >
conda install spyder=5.3.3 stuck on solving env - Stack Overflow
3 , it says failed with initial frozen solve. Retrying with flexible solve. It then never solves the environment. Any help? python ·...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
... Bug:90687 - "app-emulation/bochs: ebuild does not support pci nor pcidev linux kernel module" status:RESOLVED resolution:OBSOLETE severity:enhancement ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found