File tree Expand file tree Collapse file tree 4 files changed +9
-18
lines changed Expand file tree Collapse file tree 4 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,12 @@ def pytest_collection_modifyitems(items):
41
41
42
42
43
43
@pytest .fixture
44
- async def io_loop (event_loop , request ):
44
+ async def io_loop (request ):
45
45
"""Create tornado io_loop on current asyncio event loop"""
46
46
if tornado is None :
47
47
pytest .skip ()
48
48
io_loop = IOLoop .current ()
49
- assert asyncio .get_event_loop () is event_loop
50
- assert io_loop .asyncio_loop is event_loop
49
+ assert io_loop .asyncio_loop is asyncio .get_running_loop ()
51
50
52
51
def _close ():
53
52
io_loop .close (all_fds = True )
@@ -70,15 +69,6 @@ def term_context(ctx, timeout):
70
69
)
71
70
72
71
73
- @pytest .fixture
74
- def event_loop ():
75
- loop = asyncio .new_event_loop ()
76
- yield loop
77
- loop .close ()
78
- # make sure selectors are cleared
79
- assert dict (zmq .asyncio ._selectors ) == {}
80
-
81
-
82
72
@pytest .fixture
83
73
def sigalrm_timeout ():
84
74
"""Set timeout using SIGALRM
Original file line number Diff line number Diff line change 17
17
18
18
19
19
@pytest .fixture
20
- def Context (event_loop ):
20
+ async def Context ():
21
21
return zaio .Context
22
22
23
23
Original file line number Diff line number Diff line change 23
23
24
24
25
25
@pytest .fixture
26
- def Context (event_loop ):
26
+ async def Context ():
27
27
return zmq .asyncio .Context
28
28
29
29
@@ -93,7 +93,7 @@ def certs(secret_keys_dir):
93
93
94
94
95
95
@pytest .fixture
96
- async def _async_setup (request , event_loop ):
96
+ async def _async_setup (request ):
97
97
"""pytest doesn't support async setup/teardown"""
98
98
instance = request .instance
99
99
await instance .async_setup ()
@@ -407,7 +407,7 @@ def make_auth(self):
407
407
return AsyncioAuthenticator (self .context )
408
408
409
409
410
- async def test_ioloop_authenticator (context , event_loop , io_loop ):
410
+ async def test_ioloop_authenticator (context , io_loop ):
411
411
from tornado .ioloop import IOLoop
412
412
413
413
with warnings .catch_warnings ():
Original file line number Diff line number Diff line change 1
1
# Copyright (C) PyZMQ Developers
2
2
# Distributed under the terms of the Modified BSD License.
3
3
4
+ import pytest
5
+
4
6
import zmq
5
7
import zmq .asyncio
6
8
from zmq .utils .monitor import recv_monitor_message
7
9
from zmq_test_utils import require_zmq_4
8
10
9
11
pytestmark = require_zmq_4
10
- import pytest
11
12
12
13
13
14
@pytest .fixture (params = ["zmq" , "asyncio" ])
14
- def Context (request , event_loop ):
15
+ async def Context (request ):
15
16
if request .param == "asyncio" :
16
17
return zmq .asyncio .Context
17
18
else :
You can’t perform that action at this time.
0 commit comments