13
13
14
14
from distributed import Future , Client
15
15
from distributed .utils import sync
16
- from distributed .utils_test import gen_cluster , inc , cluster , loop , slowinc # noqa: F401
16
+ from distributed .utils_test import gen_cluster , loop , loop_in_thread , cleanup , inc , cluster , loop , slowinc # noqa: F401
17
17
18
18
19
+ @pytest .mark .asyncio
19
20
@gen_cluster (client = True )
20
21
async def test_map (c , s , a , b ):
21
22
source = Stream (asynchronous = True )
@@ -30,6 +31,7 @@ async def test_map(c, s, a, b):
30
31
assert all (isinstance (f , Future ) for f in futures_L )
31
32
32
33
34
+ @pytest .mark .asyncio
33
35
@gen_cluster (client = True )
34
36
async def test_map_on_dict (c , s , a , b ):
35
37
# dask treats dicts differently, so we have to make sure
@@ -52,6 +54,7 @@ def add_to_dict(d):
52
54
assert item ["i" ] == i
53
55
54
56
57
+ @pytest .mark .asyncio
55
58
@gen_cluster (client = True )
56
59
async def test_partition_then_scatter_async (c , s , a , b ):
57
60
# Ensure partition w/ timeout before scatter works correctly for
@@ -92,6 +95,7 @@ def test_partition_then_scatter_sync(loop):
92
95
assert L == [1 , 2 , 3 ]
93
96
94
97
98
+ @pytest .mark .asyncio
95
99
@gen_cluster (client = True )
96
100
async def test_non_unique_emit (c , s , a , b ):
97
101
"""Regression for https://github.com/python-streamz/streams/issues/397
@@ -110,6 +114,7 @@ async def test_non_unique_emit(c, s, a, b):
110
114
assert L [0 ] != L [1 ] or L [0 ] != L [2 ]
111
115
112
116
117
+ @pytest .mark .asyncio
113
118
@gen_cluster (client = True )
114
119
async def test_scan (c , s , a , b ):
115
120
source = Stream (asynchronous = True )
@@ -124,6 +129,7 @@ async def test_scan(c, s, a, b):
124
129
assert all (isinstance (f , Future ) for f in futures_L )
125
130
126
131
132
+ @pytest .mark .asyncio
127
133
@gen_cluster (client = True )
128
134
async def test_scan_state (c , s , a , b ):
129
135
source = Stream (asynchronous = True )
@@ -139,6 +145,7 @@ def f(acc, i):
139
145
assert L == [0 , 1 , 3 ]
140
146
141
147
148
+ @pytest .mark .asyncio
142
149
@gen_cluster (client = True )
143
150
async def test_zip (c , s , a , b ):
144
151
a = Stream (asynchronous = True )
@@ -155,6 +162,7 @@ async def test_zip(c, s, a, b):
155
162
assert L == [(1 , 'a' ), (2 , 'b' )]
156
163
157
164
165
+ @pytest .mark .asyncio
158
166
@gen_cluster (client = True )
159
167
async def test_accumulate (c , s , a , b ):
160
168
source = Stream (asynchronous = True )
@@ -192,6 +200,7 @@ def test_sync_2(loop): # noqa: F811
192
200
assert L == list (map (inc , range (10 )))
193
201
194
202
203
+ @pytest .mark .asyncio
195
204
@gen_cluster (client = True , nthreads = [('127.0.0.1' , 1 )] * 2 )
196
205
async def test_buffer (c , s , a , b ):
197
206
source = Stream (asynchronous = True )
@@ -241,6 +250,7 @@ def test_buffer_sync(loop): # noqa: F811
241
250
assert L == list (map (inc , range (10 )))
242
251
243
252
253
+ @pytest .mark .asyncio
244
254
@pytest .mark .xfail (reason = '' )
245
255
async def test_stream_shares_client_loop (loop ): # noqa: F811
246
256
with cluster () as (s , [a , b ]):
@@ -250,6 +260,7 @@ async def test_stream_shares_client_loop(loop): # noqa: F811
250
260
assert source .loop is client .loop
251
261
252
262
263
+ @pytest .mark .asyncio
253
264
@gen_cluster (client = True )
254
265
async def test_starmap (c , s , a , b ):
255
266
def add (x , y , z = 0 ):
0 commit comments