Sync from SUSE:SLFO:1.1 python-pytest-qt revision 36316788cf20e5a81475a374522de7a5

This commit is contained in:
2025-04-16 02:00:47 +02:00
parent 3e426da527
commit 9c6e80be02
5 changed files with 21 additions and 112 deletions

View File

@@ -1,34 +0,0 @@
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."

BIN
pytest-qt-4.2.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
pytest-qt-4.4.0.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,64 +1,3 @@
-------------------------------------------------------------------
Thu Feb 27 09:22:15 UTC 2025 - Antonio Larrosa <alarrosa@suse.com>
- Add patch to fix a test that fails when building with the latest
pyside6 instead of skipping it:
* fix-pyside6-test.patch
-------------------------------------------------------------------
Wed Feb 26 13:29:50 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
- Skip test_qtinfo failing test with latest python3-pyside6
-------------------------------------------------------------------
Wed May 29 10:45:04 UTC 2024 - Antonio Larrosa <alarrosa@suse.com>
- Run test_destroyed again, the problem was fixed in the
python3-pyside6 package.
-------------------------------------------------------------------
Tue May 28 06:16:27 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Skip test_destroyed, this test fails with pyside6 6.7.0
-------------------------------------------------------------------
Sat Mar 16 09:34:01 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 4.4.0:
* Fixed exception handling so they are properly cleared in
Python 3.12, due to the new sys.last_exc attribute (#532).
-------------------------------------------------------------------
Sun Jan 28 17:40:13 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Don't require any backend. The testing application should
specify their set explicitly.
- Test pyside on SLE15 python module
-------------------------------------------------------------------
Thu Jan 25 15:13:50 UTC 2024 - Ben Greiner <code@bnavigator.de>
- %sle15_python_module_pythons must define %pythons before any
%python_module usage
-------------------------------------------------------------------
Fri Jan 5 17:11:51 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 4.3.1:
* Added official support for Python 3.12.
* Python 3.7 is no longer supported.
* qapp now sets up the QApplication instance with a command
line argument like this QApplication([prog_name]) instead of
using an empty list QApplication([]). Here prog_name is the
name of the app which defaults to pytest-qt-app, but can be
redefined in the pytest.ini file, see :ref:`qapp
fixture<setting-qapp-name>`. Alternatively, the arguments
that will be passed to QApplication can be defined explicitly
using the qapp_args fixture. This means that the default
behavior of the qapp_args fixture is now also changed
accordingly: it now returns the list [prog_name] instead of
an empty list.
-------------------------------------------------------------------
Fri Jun 23 19:07:24 UTC 2023 - Ben Greiner <code@bnavigator.de>
@@ -220,8 +159,8 @@ Mon Jun 14 15:02:19 UTC 2021 - Ben Greiner <code@bnavigator.de>
* Errors related to the ``qt_compat`` module (such as an invalid
``PYTEST_QT_API`` setting or missing Qt API wrappers) are now shown as a more
human-readable error message rather than an internal pytest error (`#355`_). Thanks
`@The-Compiler`_ for the PR.
`@The-Compiler`_ for the PR.
-------------------------------------------------------------------
Fri Sep 25 09:19:58 UTC 2020 - Benjamin Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-qt
# spec file
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,9 +16,6 @@
#
%{?sle15_python_module_pythons}
# pyside is for one flavor only
%define pyside_python %{?sle15_python_module_pythons:%pythons}%{!?sle15_python_module_pythons:python3}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
%define psuffix %{nil}
@@ -44,7 +41,8 @@ BuildConflicts: %{python_module qt5}
%endif
%if "%{flavor}" == "test-pyside2"
%define psuffix -%{flavor}
%{!?sle15_python_module_pythons:%define pythons python3}
# pyside is for the primary python3 flavor only
%define pythons python3
%define test_qtapi pyside2
%bcond_without test
BuildRequires: %{python_module pyside2}
@@ -54,7 +52,8 @@ BuildConflicts: %{python_module qt5}
%endif
%if "%{flavor}" == "test-pyside6"
%define psuffix -%{flavor}
%{!?sle15_python_module_pythons:%define pythons python3}
# pyside is for the primary python3 flavor only
%define pythons python3
%define test_qtapi pyside6
# invalid traceback gh#pytest-dev/pytest-qt#488
%define testflavorargs --ignore tests/test_exceptions.py
@@ -64,16 +63,17 @@ BuildConflicts: %{python_module PyQt6}
BuildConflicts: %{python_module pyside2}
BuildConflicts: %{python_module qt5}
%endif
%{?sle15_python_module_pythons}
Name: python-pytest-qt%{psuffix}
Version: 4.4.0
Version: 4.2.0
Release: 0
Summary: Pytest support for PyQt and PySide applications
License: MIT
Group: Development/Languages/Python
URL: https://github.com/pytest-dev/pytest-qt
Source: https://files.pythonhosted.org/packages/source/p/pytest-qt/pytest-qt-%{version}.tar.gz
Patch0: fix-pyside6-test.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
@@ -89,6 +89,11 @@ Suggests: python-pyside2
Suggests: python-pyside6
Suggests: python-qt5
BuildArch: noarch
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
Requires: (python-qt5 or python-PyQt6 or python3-pyside2 or python3-pyside6)
%else
Requires: (python-qt5 or python-PyQt6)
%endif
%if %{with test}
BuildRequires: %{python_module pytest-qt = %{version}}
BuildRequires: %{python_module pytest}
@@ -104,7 +109,7 @@ creation as needed and provides methods to simulate user interaction,
like key presses and mouse clicks.
%prep
%autosetup -p1 -n pytest-qt-%{version}
%setup -q -n pytest-qt-%{version}
dos2unix LICENSE
# https://github.com/pytest-dev/pytest-qt/pull/419#discussion_r1240198866
sed -i /xfail_strict/d setup.cfg
@@ -124,7 +129,6 @@ sed -i /xfail_strict/d setup.cfg
%check
export QT_QPA_PLATFORM=offscreen
export PYTEST_QT_API=%{test_qtapi}
%pytest %{?testflavorargs} -rsxXfE
%endif