diff --git a/python-i3ipc.changes b/python-i3ipc.changes index 6eadb86..1b167b0 100644 --- a/python-i3ipc.changes +++ b/python-i3ipc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 5 15:21:20 UTC 2025 - Markéta Machová + +- Add pytest-asyncio dependency and test-aio.patch to fix tests +- Skip some misbehaving tests + ------------------------------------------------------------------- Wed May 28 11:44:55 UTC 2025 - Markéta Machová diff --git a/python-i3ipc.spec b/python-i3ipc.spec index 862a903..ad1702a 100644 --- a/python-i3ipc.spec +++ b/python-i3ipc.spec @@ -1,7 +1,7 @@ # # spec file for package python-i3ipc # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,8 +25,11 @@ License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/altdesktop/i3ipc-python Source0: https://github.com/altdesktop/i3ipc-python/archive/v%{version}.tar.gz#/i3ipc-%{version}.tar.gz +# PATCH-FIX-OPENSUSE https://github.com/altdesktop/i3ipc-python/issues/217 +Patch0: test-aio.patch BuildRequires: %{python_module asyncio} BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-xlib} BuildRequires: %{python_module setuptools} @@ -51,7 +54,7 @@ also features a publish/subscribe mechanism for notifying interested parties of window manager events. %prep -%setup -q -n i3ipc-python-%{version} +%autosetup -p1 -n i3ipc-python-%{version} sed -i "s/'enum-compat'//" setup.py # Remove shebang which is not needed (that script cannot be executed @@ -69,13 +72,15 @@ find examples/ -name \*.py -exec chmod -x '{}' \; %python_expand %fdupes %{buildroot}%{$python_sitelib} %check + # test_shutdown_event_reconnect always fails # test_restart fails on openSUSE/SLE 15 # test_window_event is intermittent # test_detailed_window_event stucks in obs, not with the local build (https://github.com/altdesktop/i3ipc-python/issues/192) +# test_workspace gets stuck, test_event_exception and test_tick_event get lost in new asyncio loops https://github.com/altdesktop/i3ipc-python/issues/217 %{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} xvfb-run --server-args "-screen 0 1920x1080x24" \ - $python -m pytest -k 'not (test_shutdown_event_reconnect or test_restart or test_window_event or test_detailed_window_event)' + $python -m pytest -k 'not (test_shutdown_event_reconnect or test_restart or test_window_event or test_detailed_window_event or test_workspace or test_event_exception or test_tick_event)' } %files %{python_files} diff --git a/test-aio.patch b/test-aio.patch new file mode 100644 index 0000000..3b3d19b --- /dev/null +++ b/test-aio.patch @@ -0,0 +1,28 @@ +Index: i3ipc-python-2.2.1/test/aio/ipctest.py +=================================================================== +--- i3ipc-python-2.2.1.orig/test/aio/ipctest.py ++++ i3ipc-python-2.2.1/test/aio/ipctest.py +@@ -1,5 +1,9 @@ + from subprocess import Popen + import pytest ++try: ++ from pytest_asyncio import fixture ++except ImportError: ++ from pytest import fixture + + from i3ipc.aio import Connection + from i3ipc import CommandReply +@@ -15,11 +19,11 @@ class IpcTest: + timeout_thread = None + i3_conn = None + +- @pytest.fixture(scope='class') ++ @fixture(scope='class') + def event_loop(self): + return asyncio.get_event_loop() + +- @pytest.fixture(scope='class') ++ @fixture(scope='class') + async def i3(self): + process = Popen(['i3', '-c', 'test/i3.config']) + # wait for i3 to start up