Description: Make test functions async
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: https://bugs.debian.org/1115802
Forwarded: no
Last-Update: 2025-09-29

Index: python-autobahn/autobahn/asyncio/test/test_aio_rawsocket.py
===================================================================
--- python-autobahn.orig/autobahn/asyncio/test/test_aio_rawsocket.py
+++ python-autobahn/autobahn/asyncio/test/test_aio_rawsocket.py
@@ -11,7 +11,8 @@ from autobahn.wamp.types import Transpor
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_sers(event_loop):
+@pytest.mark.asyncio
+async def test_sers():
     serializers = get_serializers()
     assert len(serializers) > 0
     m = serializers[0]().serialize(message.Abort('close'))
@@ -19,7 +20,8 @@ def test_sers(event_loop):
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_prefix(event_loop):
+@pytest.mark.asyncio
+async def test_prefix():
     p = PrefixProtocol()
     transport = Mock()
     receiver = Mock()
@@ -62,7 +64,8 @@ def test_prefix(event_loop):
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_is_closed(event_loop):
+@pytest.mark.asyncio
+async def test_is_closed():
     class CP(RawSocketClientProtocol):
         @property
         def serializer_id(self):
@@ -83,7 +86,8 @@ def test_is_closed(event_loop):
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_raw_socket_server1(event_loop):
+@pytest.mark.asyncio
+async def test_raw_socket_server1():
 
     server = RawSocketServerProtocol()
     ser = Mock(return_value=True)
@@ -108,7 +112,8 @@ def test_raw_socket_server1(event_loop):
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_raw_socket_server_errors(event_loop):
+@pytest.mark.asyncio
+async def test_raw_socket_server_errors():
 
     server = RawSocketServerProtocol()
     ser = Mock(return_value=True)
@@ -139,7 +144,8 @@ def test_raw_socket_server_errors(event_
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_raw_socket_client1(event_loop):
+@pytest.mark.asyncio
+async def test_raw_socket_client1():
     class CP(RawSocketClientProtocol):
         @property
         def serializer_id(self):
@@ -162,7 +168,8 @@ def test_raw_socket_client1(event_loop):
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_raw_socket_client_error(event_loop):
+@pytest.mark.asyncio
+async def test_raw_socket_client_error():
     class CP(RawSocketClientProtocol):
         @property
         def serializer_id(self):
@@ -181,7 +188,8 @@ def test_raw_socket_client_error(event_l
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_wamp_server(event_loop):
+@pytest.mark.asyncio
+async def test_wamp_server():
     transport = Mock(spec_set=('abort', 'close', 'write', 'get_extra_info'))
     transport.write = Mock(side_effect=lambda m: messages.append(m))
     server = Mock(spec=['onOpen', 'onMessage'])
@@ -209,7 +217,8 @@ def test_wamp_server(event_loop):
 
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_wamp_client(event_loop):
+@pytest.mark.asyncio
+async def test_wamp_client():
     transport = Mock(spec_set=('abort', 'close', 'write', 'get_extra_info'))
     transport.write = Mock(side_effect=lambda m: messages.append(m))
     client = Mock(spec=['onOpen', 'onMessage'])
Index: python-autobahn/autobahn/asyncio/test/test_aio_websocket.py
===================================================================
--- python-autobahn.orig/autobahn/asyncio/test/test_aio_websocket.py
+++ python-autobahn/autobahn/asyncio/test/test_aio_websocket.py
@@ -23,7 +23,8 @@ async def test_echo_async():
 
 # @pytest.mark.asyncio(forbid_global_loop=True)
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_websocket_custom_loop(event_loop):
+@pytest.mark.asyncio
+async def test_websocket_custom_loop():
     factory = WebSocketServerFactory(loop=event_loop)
     server = factory()
     transport = Mock()
@@ -32,7 +33,7 @@ def test_websocket_custom_loop(event_loo
 
 @pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
 @pytest.mark.asyncio
-async def test_async_on_connect_server(event_loop):
+async def test_async_on_connect_server():
 
     num = 42
     done = txaio.create_future()
