pyside6 instead of skipping it: * fix-pyside6-test.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-qt?expand=0&rev=38
35 lines
1.2 KiB
Diff
35 lines
1.2 KiB
Diff
From: Antonio Larrosa <alarrosa@suse.com>
|
|
Subject: Fix test_qinfo when building with latest pyside6
|
|
|
|
The qInfo test fails when detecting it's running with pyside because
|
|
it assumes pyside2/6 doesn't expose qInfo. But pyside6 does. So we
|
|
can just remove the case from the condition and let the qInfo test
|
|
run normally.
|
|
|
|
Index: pytest-qt-4.4.0/tests/test_logging.py
|
|
===================================================================
|
|
--- pytest-qt-4.4.0.orig/tests/test_logging.py
|
|
+++ pytest-qt-4.4.0/tests/test_logging.py
|
|
@@ -3,6 +3,7 @@ import datetime
|
|
import pytest
|
|
|
|
from pytestqt.qt_compat import qt_api
|
|
+from packaging.version import Version
|
|
|
|
|
|
@pytest.mark.parametrize("test_succeeds", [True, False])
|
|
@@ -72,7 +73,12 @@ def test_qinfo(qtlog):
|
|
the other logging tests properly. #232
|
|
"""
|
|
|
|
- if qt_api.is_pyside:
|
|
+ if qt_api.pytest_qt_api == "pyside6":
|
|
+ import PySide6
|
|
+ pyside6_version = Version(PySide6.__version__)
|
|
+
|
|
+ if (qt_api.pytest_qt_api == "pyside2" or
|
|
+ (qt_api.pytest_qt_api == "pyside6" and pyside6_version < Version("6.8.2"))):
|
|
assert (
|
|
qt_api.qInfo is None
|
|
), "pyside2/6 does not expose qInfo. If it does, update this test."
|