3 Commits

3 changed files with 3 additions and 42 deletions

View File

@@ -1,9 +1,3 @@
-------------------------------------------------------------------
Fri Sep 5 15:21:20 UTC 2025 - Markéta Machová <mmachova@suse.com>
- 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á <mmachova@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-i3ipc
#
# Copyright (c) 2025 SUSE LLC and contributors
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,11 +25,8 @@ 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}
@@ -54,7 +51,7 @@ also features a publish/subscribe mechanism for notifying interested parties of
window manager events.
%prep
%autosetup -p1 -n i3ipc-python-%{version}
%setup -q -n i3ipc-python-%{version}
sed -i "s/'enum-compat'//" setup.py
# Remove shebang which is not needed (that script cannot be executed
@@ -72,15 +69,13 @@ 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 or test_workspace or test_event_exception or test_tick_event)'
$python -m pytest -k 'not (test_shutdown_event_reconnect or test_restart or test_window_event or test_detailed_window_event)'
}
%files %{python_files}

View File

@@ -1,28 +0,0 @@
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