Skip to content

Commit

Permalink
Remove PySide2 skip conditions and fix PySide2 signal emit calls fail…
Browse files Browse the repository at this point in the history
…ures (napari#107)

* Remove PySide2 skip conditions hiding pending issues to address related with Signal handling on PySide2

* Use 'object' instead of 'StringEnum' to define 'actionRequested' signal
  • Loading branch information
dalthviz authored Sep 27, 2024
1 parent a764714 commit dbcd362
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
37 changes: 0 additions & 37 deletions napari_plugin_manager/_tests/test_qt_plugin_dialog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import importlib.metadata
import os
import platform
import sys
from typing import Generator, Optional, Tuple
from unittest.mock import patch
Expand Down Expand Up @@ -406,12 +405,6 @@ def test_add_items_outdated_and_update(plugin_dialog, qtbot):
assert widget.version.toolTip() == updated_version


@pytest.mark.skipif(
qtpy.API_NAME.lower().startswith('pyside')
and sys.version_info[:2] > (3, 10)
and platform.system() == "Darwin",
reason='pyside specific bug',
)
def test_refresh(qtbot, plugin_dialog):
with qtbot.waitSignal(plugin_dialog._add_items_timer.timeout, timeout=500):
plugin_dialog.refresh(clear_cache=False)
Expand All @@ -423,35 +416,17 @@ def test_refresh(qtbot, plugin_dialog):
plugin_dialog._refresh_and_clear_cache()


@pytest.mark.skipif(
qtpy.API_NAME.lower().startswith('pyside')
and sys.version_info[:2] > (3, 10)
and platform.system() == "Darwin",
reason='pyside specific bug',
)
def test_toggle_status(plugin_dialog):
plugin_dialog.toggle_status(True)
assert plugin_dialog.stdout_text.isVisible()
plugin_dialog.toggle_status(False)
assert not plugin_dialog.stdout_text.isVisible()


@pytest.mark.skipif(
qtpy.API_NAME.lower().startswith('pyside')
and sys.version_info[:2] > (3, 10)
and platform.system() == "Darwin",
reason='pyside specific bug',
)
def test_exec(plugin_dialog):
plugin_dialog.exec_()


@pytest.mark.skipif(
qtpy.API_NAME.lower().startswith('pyside')
and sys.version_info[:2] > (3, 10)
and platform.system() == "Darwin",
reason='pyside specific bug',
)
def test_search_in_available(plugin_dialog):
idxs = plugin_dialog._search_in_available("test")
assert idxs == [0, 1, 2, 3]
Expand All @@ -474,9 +449,6 @@ def test_drop_event(plugin_dialog, tmp_path):
assert plugin_dialog.direct_entry_edit.text() == str(path_1)


@pytest.mark.skipif(
qtpy.API_NAME.lower().startswith('pyside'), reason='pyside specific bug'
)
def test_installs(qtbot, tmp_virtualenv, plugin_dialog, request):
if "[constructor]" in request.node.name:
pytest.skip(
Expand All @@ -497,9 +469,6 @@ def test_installs(qtbot, tmp_virtualenv, plugin_dialog, request):
qtbot.wait(5000)


@pytest.mark.skipif(
qtpy.API_NAME.lower().startswith('pyside'), reason='pyside specific bug'
)
def test_cancel(qtbot, tmp_virtualenv, plugin_dialog, request):
if "[constructor]" in request.node.name:
pytest.skip(
Expand All @@ -522,9 +491,6 @@ def test_cancel(qtbot, tmp_virtualenv, plugin_dialog, request):
assert plugin_dialog.installed_list.count() == 2


@pytest.mark.skipif(
qtpy.API_NAME.lower().startswith('pyside'), reason='pyside specific bug'
)
def test_cancel_all(qtbot, tmp_virtualenv, plugin_dialog, request):
if "[constructor]" in request.node.name:
pytest.skip(
Expand All @@ -545,9 +511,6 @@ def test_cancel_all(qtbot, tmp_virtualenv, plugin_dialog, request):
assert plugin_dialog.installed_list.count() == 2


@pytest.mark.skipif(
qtpy.API_NAME.lower().startswith('pyside'), reason='pyside specific bug'
)
def test_direct_entry_installs(qtbot, tmp_virtualenv, plugin_dialog, request):
if "[constructor]" in request.node.name:
pytest.skip(
Expand Down
3 changes: 1 addition & 2 deletions napari_plugin_manager/qt_plugin_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from napari.plugins.utils import normalized_name
from napari.settings import get_settings
from napari.utils.misc import (
StringEnum,
parse_version,
running_as_constructor_app,
)
Expand Down Expand Up @@ -105,7 +104,7 @@ class PluginListItem(QFrame):
author, source, version, and buttons to update, install/uninstall, etc."""

# item, package_name, action_name, version, installer_choice
actionRequested = Signal(QListWidgetItem, str, StringEnum, str, StringEnum)
actionRequested = Signal(QListWidgetItem, str, object, str, object)

def __init__(
self,
Expand Down

0 comments on commit dbcd362

Please sign in to comment.