Skip to content

Commit 94d029a

Browse files
committed
Use await_for idiom to make tests declarative
1 parent 9a80c35 commit 94d029a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

streamz/tests/test_core.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ async def add_native(x=0, y=0):
140140

141141
yield source.emit(0)
142142

143-
yield gen.moment # Must yield to the event loop to ensure it finished
144-
assert L == [3]
143+
yield await_for(lambda: L == [3], 1)
145144

146145

147146
@pytest.mark.asyncio
@@ -158,8 +157,7 @@ async def add_native(x=0, y=0):
158157

159158
await source.emit(0)
160159

161-
await asyncio.sleep(0) # Must yield to the event loop to ensure it finished
162-
assert L == [3]
160+
await await_for(lambda: L == [3], 1)
163161

164162

165163
def test_map_args():

0 commit comments

Comments
 (0)