Skip to content

Commit

Permalink
fixup! tests: Skips tests failing with PyQt6 when PyQt6 is used
Browse files Browse the repository at this point in the history
  • Loading branch information
rear1019 committed Jan 9, 2025
1 parent 241fc9f commit 0ea8522
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from unittest.mock import MagicMock

# Third party imports
from qtpy import QT_VERSION
from qtpy import QT_VERSION, PYQT6
from qtpy.QtCore import Qt, QEvent, QPointF
from qtpy.QtGui import QTextCursor, QMouseEvent
from qtpy.QtWidgets import QApplication, QMainWindow, QTextEdit
Expand Down Expand Up @@ -438,6 +438,7 @@ def test_editor_delete_selection(codeeditor, qtbot):

@pytest.mark.skipif(QT_VERSION.startswith('5.15'),
reason='Fixed on Qt 5.15')
@pytest.mark.skipif(PYQT6, reason="Fails with PyQt6")
def test_qtbug35861(qtbot):
"""This test will detect if upstream QTBUG-35861 is fixed.
If that happens, then the workarounds for spyder-ide/spyder#12663
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from flaky import flaky
import pytest
from qtpy import PYTQ6
from qtpy.QtCore import Qt
from qtpy.QtGui import QFont, QTextCursor

Expand Down Expand Up @@ -93,6 +94,7 @@ def test_decorations(codeeditor, qtbot):


@flaky(max_runs=10)
@pytest.mark.skipif(PYQT6, reason="Fails with PyQt6")
def test_update_decorations_when_scrolling(qtbot):
"""
Test how many calls we're doing to update decorations when
Expand Down
3 changes: 3 additions & 0 deletions spyder/plugins/editor/widgets/codeeditor/tests/test_goto.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import tempfile

# Third party imports
from qtpy import PYQT6
from qtpy.QtCore import Qt, QPoint, QTimer
from qtpy.QtGui import QDesktopServices, QTextCursor
from qtpy.QtWidgets import QMessageBox
Expand All @@ -28,6 +29,7 @@
TEST_FILE_REL = 'conftest.py'


@pytest.mark.skipif(PYQT6, reason="Fails with PyQt6")
@pytest.mark.parametrize('params', [
# Parameter, expected output 1, full file path, expected output 2
# ----------------------------------------------------------------
Expand Down Expand Up @@ -118,6 +120,7 @@ def test_goto_uri(qtbot, codeeditor, mocker, params):
assert expected_output_2 == output_2


@pytest.mark.skipif(PYQT6, reason="Fails with PyQt6")
def test_goto_uri_project_root_path(qtbot, codeeditor, mocker, tmpdir):
"""Test that the uri search is working correctly."""
code_editor = codeeditor
Expand Down
2 changes: 2 additions & 0 deletions spyder/plugins/editor/widgets/editorstack/tests/test_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Third party imports
from flaky import flaky
import pytest
from qtpy import PYQT6
from qtpy.QtCore import Qt

# Local imports
Expand Down Expand Up @@ -211,6 +212,7 @@ def test_save(editor_bot, mocker):
editor_stack.file_saved = save_file_saved


@pytest.mark.skipif(PYQT6, reason="Fails with PyQt6")
def test_file_saved_in_other_editorstack(editor_splitter_layout_bot):
"""Test EditorStack.file_saved_in_other_editorstack()."""
es = editor_splitter_layout_bot
Expand Down
1 change: 1 addition & 0 deletions spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,7 @@ def test_pdb_comprehension_namespace(ipyconsole, qtbot, tmpdir):

@flaky(max_runs=10)
@pytest.mark.auto_backend
@pytest.mark.skipif(PYQT6, reason="Fails with PyQt6")
def test_restart_interactive_backend(ipyconsole, qtbot):
"""
Test that we ask for a restart or not after switching to different
Expand Down
2 changes: 2 additions & 0 deletions spyder/plugins/run/tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# Third-part imports
import pytest
from qtpy import PYQT6
from qtpy.QtCore import Signal, Qt
from qtpy.QtWidgets import (
QAction, QWidget, QCheckBox, QLineEdit, QVBoxLayout, QHBoxLayout, QLabel)
Expand Down Expand Up @@ -360,6 +361,7 @@ def run_mock(qtbot, tmpdir):
return run, mock_main_window, temp_dir


@pytest.mark.skipif(PYQT6, reason="Fails with PyQt6")
def test_run_plugin(qtbot, run_mock):
run, main_window, temp_cwd = run_mock

Expand Down

0 comments on commit 0ea8522

Please sign in to comment.