Skip to content

Commit 37830c9

Browse files
committed
Remove event_loop fixture from tests
It was removed in pytest-asyncio 1.0 pytest-dev/pytest-asyncio#1106
1 parent ab566e1 commit 37830c9

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

test/test_aio_low_level.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from dbus_next.aio import MessageBus
22
from dbus_next import Message, MessageType, MessageFlag
33

4+
import asyncio
45
import pytest
56

67

@@ -101,7 +102,8 @@ def message_handler_error(sent):
101102

102103

103104
@pytest.mark.asyncio
104-
async def test_sending_signals_between_buses(event_loop):
105+
async def test_sending_signals_between_buses():
106+
event_loop = asyncio.get_running_loop()
105107
bus1 = await MessageBus().connect()
106108
bus2 = await MessageBus().connect()
107109

test/test_disconnect.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
from dbus_next.aio import MessageBus
22
from dbus_next import Message
33

4+
import asyncio
45
import os
56
import pytest
67
import functools
78

89

910
@pytest.mark.asyncio
10-
async def test_bus_disconnect_before_reply(event_loop):
11+
async def test_bus_disconnect_before_reply():
1112
'''In this test, the bus disconnects before the reply comes in. Make sure
1213
the caller receives a reply with the error instead of hanging.'''
14+
event_loop = asyncio.get_running_loop()
1315
bus = MessageBus()
1416
assert not bus.connected
1517
await bus.connect()
@@ -32,7 +34,8 @@ async def test_bus_disconnect_before_reply(event_loop):
3234

3335

3436
@pytest.mark.asyncio
35-
async def test_unexpected_disconnect(event_loop):
37+
async def test_unexpected_disconnect():
38+
event_loop = asyncio.get_running_loop()
3639
bus = MessageBus()
3740
assert not bus.connected
3841
await bus.connect()

test/test_fd_passing.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from dbus_next import Message, MessageType
66
import os
77

8+
import asyncio
89
import pytest
910

1011

@@ -112,7 +113,8 @@ def message_handler(sent):
112113

113114

114115
@pytest.mark.asyncio
115-
async def test_high_level_service_fd_passing(event_loop):
116+
async def test_high_level_service_fd_passing():
117+
event_loop = asyncio.get_running_loop()
116118
bus1 = await MessageBus(negotiate_unix_fd=True).connect()
117119
bus2 = await MessageBus(negotiate_unix_fd=True).connect()
118120

@@ -212,7 +214,8 @@ def fd_listener(msg):
212214

213215

214216
@pytest.mark.asyncio
215-
async def test_sending_file_descriptor_with_proxy(event_loop):
217+
async def test_sending_file_descriptor_with_proxy():
218+
event_loop = asyncio.get_running_loop()
216219
name = 'dbus.next.test.service'
217220
path = '/test/path'
218221
interface_name = 'test.interface'

test/test_tcp_address.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99

1010
@pytest.mark.asyncio
11-
async def test_tcp_connection_with_forwarding(event_loop):
11+
async def test_tcp_connection_with_forwarding():
12+
event_loop = asyncio.get_running_loop()
1213
closables = []
1314
host = '127.0.0.1'
1415
port = '55556'

0 commit comments

Comments
 (0)