8 Commits

Author SHA256 Message Date
7e79b13fd7 Merge pull request 'Fix broken tests' (#1) from dgarcia/d-l-p-python-aiorpcX:fix-tests into factory
Reviewed-on: jirislaby/d-l-p-python-aiorpcX#1
2026-02-04 19:00:54 +01:00
3fc2f41d1c Fix broken tests
Add fix-jsonrpc-test-misc.patch to fix broken tests
gh#kyuupichan/aiorpcX#56
2026-02-04 13:46:37 +01:00
Jiri Slaby
e14039ce15 replace event_loop.patch by upstream solution 2025-07-31 09:08:29 +02:00
f686432c04 Accepting request 1296251 from devel:languages:python
- update to 0.25:
  * rawsocket: allow using custom transport class
- add event_loop.patch

OBS-URL: https://build.opensuse.org/request/show/1296251
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-aiorpcX?expand=0&rev=12
2025-07-30 09:44:44 +00:00
8d70d39f66 add more patches
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiorpcX?expand=0&rev=26
2025-07-29 07:35:19 +00:00
ab5a25cce2 add more patches
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiorpcX?expand=0&rev=25
2025-07-29 07:34:48 +00:00
e92fe95b84 add more patches
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiorpcX?expand=0&rev=24
2025-07-29 07:33:19 +00:00
4ba6b1b21e up to 0.25 and fix build
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiorpcX?expand=0&rev=23
2025-07-29 07:22:27 +00:00
6 changed files with 203 additions and 7 deletions

BIN
0.24.tar.gz LFS

Binary file not shown.

BIN
0.25.0.tar.gz LFS Normal file

Binary file not shown.

View File

@@ -0,0 +1,159 @@
From: Neil Booth <kyuupichan@pm.me>
Date: Wed, 30 Jul 2025 14:41:44 -0400
Subject: Remove event_loop fixture usage from tests
References: event-loop-fix
Git-repo: https://github.com/kyuupichan/aiorpcX
Git-commit: b8ce32889c45c98b44c4e247ec0b0ae206e9ee91
Patch-mainline: yes
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
tests/test_session.py | 43 +++++++++-------------------------------
tests/test_socks.py | 6 +++---
tests/test_unixsocket.py | 16 +++++----------
tests/test_util.py | 3 ++-
4 files changed, 19 insertions(+), 49 deletions(-)
diff --git a/tests/test_session.py b/tests/test_session.py
index 8877fca3e839..f52ab6b03018 100755
--- a/tests/test_session.py
+++ b/tests/test_session.py
@@ -17,13 +17,6 @@ from aiorpcx.session import Concurrency
from util import RaiseTest
-if sys.version_info >= (3, 7):
- from asyncio import all_tasks
-else:
- from asyncio import Task
- all_tasks = Task.all_tasks
-
-
def raises_method_not_found(message):
return RaiseTest(JSONRPC.METHOD_NOT_FOUND, message, RPCError)
@@ -86,21 +79,12 @@ def caplog_count(caplog, message):
@pytest.fixture
-def server_port(unused_tcp_port, event_loop):
- coro = serve_rs(MyServerSession, 'localhost', unused_tcp_port, loop=event_loop)
- server = event_loop.run_until_complete(coro)
+async def server_port(unused_tcp_port):
+ server = await serve_rs(MyServerSession, 'localhost', unused_tcp_port)
yield unused_tcp_port
- if hasattr(asyncio, 'all_tasks'):
- tasks = asyncio.all_tasks(event_loop)
- else:
- tasks = asyncio.Task.all_tasks(loop=event_loop)
- async def close_all():
- server.close()
- await server.wait_closed()
- if tasks:
- await asyncio.wait(tasks)
- event_loop.run_until_complete(close_all())
+ server.close()
+ await server.wait_closed()
class TestRPCSession:
@@ -765,21 +749,12 @@ class MessageServer(MessageSession):
@pytest.fixture
-def msg_server_port(event_loop, unused_tcp_port):
- coro = serve_rs(MessageServer, 'localhost', unused_tcp_port, loop=event_loop)
- server = event_loop.run_until_complete(coro)
+async def msg_server_port(unused_tcp_port):
+ server = await serve_rs(MessageServer, 'localhost', unused_tcp_port)
yield unused_tcp_port
- if hasattr(asyncio, 'all_tasks'):
- tasks = asyncio.all_tasks(event_loop)
- else:
- tasks = asyncio.Task.all_tasks(loop=event_loop)
-
- async def close_all():
- server.close()
- await server.wait_closed()
- if tasks:
- await asyncio.wait(tasks)
- event_loop.run_until_complete(close_all())
+
+ server.close()
+ await server.wait_closed()
def connect_message_session(host, port, proxy=None, framer=None):
diff --git a/tests/test_socks.py b/tests/test_socks.py
index 43ca282d379e..a8d3af2d500d 100755
--- a/tests/test_socks.py
+++ b/tests/test_socks.py
@@ -482,10 +482,10 @@ localhosts = ['127.0.0.1', '::1', 'localhost']
@pytest.fixture(params=localhosts)
-def proxy_address(request, event_loop, unused_tcp_port):
+async def proxy_address(request, unused_tcp_port):
host = request.param
- coro = event_loop.create_server(FakeServer, host=host, port=unused_tcp_port)
- server = event_loop.run_until_complete(coro)
+ event_loop = asyncio.get_running_loop()
+ server = await event_loop.create_server(FakeServer, host=host, port=unused_tcp_port)
yield NetAddress(host, unused_tcp_port)
server.close()
diff --git a/tests/test_unixsocket.py b/tests/test_unixsocket.py
index f75f23db0369..ae8c27fc677c 100755
--- a/tests/test_unixsocket.py
+++ b/tests/test_unixsocket.py
@@ -11,20 +11,14 @@ if sys.platform.startswith("win"):
@pytest.fixture
-def us_server(event_loop):
+async def us_server():
+ event_loop = asyncio.get_running_loop()
with tempfile.TemporaryDirectory() as tmp_folder:
socket_path = path.join(tmp_folder, 'test.socket')
- coro = serve_us(MyServerSession, socket_path, loop=event_loop)
- server = event_loop.run_until_complete(coro)
+ server = await serve_us(MyServerSession, socket_path)
yield socket_path
- tasks = asyncio.all_tasks(event_loop)
-
- async def close_all():
- server.close()
- await server.wait_closed()
- if tasks:
- await asyncio.wait(tasks)
- event_loop.run_until_complete(close_all())
+ server.close()
+ await server.wait_closed()
class TestUSTransport:
diff --git a/tests/test_util.py b/tests/test_util.py
index 8ce9691cd60d..5980607202a8 100755
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -15,6 +15,7 @@ async def coro(x, y):
def test_is_async_call():
+ event_loop = asyncio.new_event_loop()
z = coro(2, 3)
assert not is_async_call(z)
assert is_async_call(coro)
@@ -23,7 +24,7 @@ def test_is_async_call():
assert not is_async_call(test_is_async_call)
assert not is_async_call(partial(is_async_call))
# Lose a warning
- asyncio.get_event_loop().run_until_complete(z)
+ event_loop.run_until_complete(z)
@pytest.mark.parametrize("hostname,answer", (
--
2.50.1

View File

@@ -0,0 +1,13 @@
Index: aiorpcX-0.25.0/tests/test_jsonrpc.py
===================================================================
--- aiorpcX-0.25.0.orig/tests/test_jsonrpc.py
+++ aiorpcX-0.25.0/tests/test_jsonrpc.py
@@ -1064,7 +1064,7 @@ async def test_max_response_size(protoco
await group.spawn(send_batch(batch))
-def test_misc(protocol):
+async def test_misc(protocol):
'''Misc tests to get full coverage.'''
connection = JSONRPCConnection(protocol)

View File

@@ -1,3 +1,24 @@
-------------------------------------------------------------------
Wed Feb 4 12:44:25 UTC 2026 - Daniel Garcia <daniel.garcia@suse.com>
- Add fix-jsonrpc-test-misc.patch to fix broken tests
gh#kyuupichan/aiorpcX#56
-------------------------------------------------------------------
Thu Jul 31 06:56:43 UTC 2025 - Jiri Slaby <jslaby@suse.cz>
- replace a non-upstream patch:
event_loop.patch
by an upstream one:
0001-Remove-event_loop-fixture-usage-from-tests.patch
-------------------------------------------------------------------
Tue Jul 29 07:18:50 UTC 2025 - Jiri Slaby <jslaby@suse.cz>
- update to 0.25:
* rawsocket: allow using custom transport class
- add event_loop.patch
-------------------------------------------------------------------
Tue Mar 25 06:51:46 UTC 2025 - Jiri Slaby <jslaby@suse.cz>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-aiorpcX
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2026 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
@@ -18,13 +18,16 @@
%{?sle15_python_module_pythons}
Name: python-aiorpcX
Version: 0.24
Version: 0.25.0
Release: 0
Summary: Generic async RPC implementation, including JSON-RPC
License: MIT
Group: Development/Languages/Python
URL: https://github.com/kyuupichan/aiorpcX
Source: https://github.com/kyuupichan/aiorpcX/archive/%{version}.tar.gz
Patch0: 0001-Remove-event_loop-fixture-usage-from-tests.patch
# PATCH-FIX-OPENSUSE fix-jsonrpc-test-misc.patch -- gh#kyuupichan/aiorpcX#56
Patch1: fix-jsonrpc-test-misc.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
@@ -47,7 +50,7 @@ BuildRequires: %{python_module websockets}
Generic async RPC implementation, including JSON-RPC
%prep
%setup -q -n aiorpcX-%{version}
%autosetup -p1 -n aiorpcX-%{version}
# needs network
rm tests/test_websocket.py
chmod a-x LICENCE README.rst docs/*
@@ -72,6 +75,6 @@ SKIP_TESTS="$SKIP_TESTS or test_cancel_remaining_on_group_with_stubborn_task"
%doc README.rst docs/*.rst
%license LICENCE
%{python_sitelib}/aiorpcx
%{python_sitelib}/aiorpc[xX]-%{version}.0.dist-info
%{python_sitelib}/aiorpc[xX]-%{version}.dist-info
%changelog