commit:     d1d5eff79e80198a67752be8ed70dbc587b49a50
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 15:35:44 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 15:39:26 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1d5eff7

dev-python/dbus-next: Backport test failure fix

Closes: https://bugs.gentoo.org/970438
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild     |   9 +-
 .../files/dbus-next-0.2.3-pytest-asyncio-1.patch   | 115 +++++++++++++++++++++
 2 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild 
b/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild
index 509b350823e0..9d6150cb0fc7 100644
--- a/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild
+++ b/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..13} )
+PYTHON_COMPAT=( python3_{11..13} )
 
 inherit distutils-r1 virtualx
 
@@ -27,13 +27,13 @@ KEYWORDS="amd64 ~arm64 ~riscv x86"
 BDEPEND="
        test? (
                dev-python/pygobject[${PYTHON_USEDEP}]
-               dev-python/pytest-asyncio[${PYTHON_USEDEP}]
-               dev-python/pytest-timeout[${PYTHON_USEDEP}]
        )
 "
 
 PATCHES=(
        "${FILESDIR}"/${PN}-0.2.3-glib-crash.patch
+       # https://github.com/altdesktop/python-dbus-next/pull/171
+       "${FILESDIR}"/${PN}-0.2.3-pytest-asyncio-1.patch
 )
 
 EPYTEST_DESELECT=(
@@ -47,6 +47,7 @@ EPYTEST_IGNORE=(
        test/client/test_signals.py
 )
 
+EPYTEST_PLUGINS=( pytest-{asyncio,timeout} )
 distutils_enable_tests pytest
 
 src_test() {

diff --git a/dev-python/dbus-next/files/dbus-next-0.2.3-pytest-asyncio-1.patch 
b/dev-python/dbus-next/files/dbus-next-0.2.3-pytest-asyncio-1.patch
new file mode 100644
index 000000000000..76506ddd0510
--- /dev/null
+++ b/dev-python/dbus-next/files/dbus-next-0.2.3-pytest-asyncio-1.patch
@@ -0,0 +1,115 @@
+From 37830c9972209746396f4c3f8344ce50a435b767 Mon Sep 17 00:00:00 2001
+From: LN Liberda <[email protected]>
+Date: Fri, 28 Nov 2025 06:38:51 +0100
+Subject: [PATCH] Remove event_loop fixture from tests
+
+It was removed in pytest-asyncio 1.0
+https://github.com/pytest-dev/pytest-asyncio/pull/1106
+---
+ test/test_aio_low_level.py | 4 +++-
+ test/test_disconnect.py    | 7 +++++--
+ test/test_fd_passing.py    | 7 +++++--
+ test/test_tcp_address.py   | 3 ++-
+ 4 files changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/test/test_aio_low_level.py b/test/test_aio_low_level.py
+index 1042a1a..677cbf1 100644
+--- a/test/test_aio_low_level.py
++++ b/test/test_aio_low_level.py
+@@ -1,6 +1,7 @@
+ from dbus_next.aio import MessageBus
+ from dbus_next import Message, MessageType, MessageFlag
+ 
++import asyncio
+ import pytest
+ 
+ 
+@@ -101,7 +102,8 @@ def message_handler_error(sent):
+ 
+ 
+ @pytest.mark.asyncio
+-async def test_sending_signals_between_buses(event_loop):
++async def test_sending_signals_between_buses():
++    event_loop = asyncio.get_running_loop()
+     bus1 = await MessageBus().connect()
+     bus2 = await MessageBus().connect()
+ 
+diff --git a/test/test_disconnect.py b/test/test_disconnect.py
+index d04d996..987eefe 100644
+--- a/test/test_disconnect.py
++++ b/test/test_disconnect.py
+@@ -1,15 +1,17 @@
+ from dbus_next.aio import MessageBus
+ from dbus_next import Message
+ 
++import asyncio
+ import os
+ import pytest
+ import functools
+ 
+ 
+ @pytest.mark.asyncio
+-async def test_bus_disconnect_before_reply(event_loop):
++async def test_bus_disconnect_before_reply():
+     '''In this test, the bus disconnects before the reply comes in. Make sure
+     the caller receives a reply with the error instead of hanging.'''
++    event_loop = asyncio.get_running_loop()
+     bus = MessageBus()
+     assert not bus.connected
+     await bus.connect()
+@@ -32,7 +34,8 @@ async def test_bus_disconnect_before_reply(event_loop):
+ 
+ 
+ @pytest.mark.asyncio
+-async def test_unexpected_disconnect(event_loop):
++async def test_unexpected_disconnect():
++    event_loop = asyncio.get_running_loop()
+     bus = MessageBus()
+     assert not bus.connected
+     await bus.connect()
+diff --git a/test/test_fd_passing.py b/test/test_fd_passing.py
+index 28331d3..be25e4d 100644
+--- a/test/test_fd_passing.py
++++ b/test/test_fd_passing.py
+@@ -5,6 +5,7 @@
+ from dbus_next import Message, MessageType
+ import os
+ 
++import asyncio
+ import pytest
+ 
+ 
+@@ -112,7 +113,8 @@ def message_handler(sent):
+ 
+ 
+ @pytest.mark.asyncio
+-async def test_high_level_service_fd_passing(event_loop):
++async def test_high_level_service_fd_passing():
++    event_loop = asyncio.get_running_loop()
+     bus1 = await MessageBus(negotiate_unix_fd=True).connect()
+     bus2 = await MessageBus(negotiate_unix_fd=True).connect()
+ 
+@@ -212,7 +214,8 @@ def fd_listener(msg):
+ 
+ 
+ @pytest.mark.asyncio
+-async def test_sending_file_descriptor_with_proxy(event_loop):
++async def test_sending_file_descriptor_with_proxy():
++    event_loop = asyncio.get_running_loop()
+     name = 'dbus.next.test.service'
+     path = '/test/path'
+     interface_name = 'test.interface'
+diff --git a/test/test_tcp_address.py b/test/test_tcp_address.py
+index a6b6ebb..fe2fc3e 100644
+--- a/test/test_tcp_address.py
++++ b/test/test_tcp_address.py
+@@ -8,7 +8,8 @@
+ 
+ 
+ @pytest.mark.asyncio
+-async def test_tcp_connection_with_forwarding(event_loop):
++async def test_tcp_connection_with_forwarding():
++    event_loop = asyncio.get_running_loop()
+     closables = []
+     host = '127.0.0.1'
+     port = '55556'

Reply via email to