uasyncio.core: test_fair_schedule.py: More checks and iterations.

pull/261/head
Paul Sokolovsky 2018-02-05 00:19:34 +02:00
rodzic 5925aa60e2
commit bc14f2f6eb
1 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -4,11 +4,12 @@
import uasyncio.core as asyncio
COROS = 5
ITERS = 5
COROS = 10
ITERS = 20
result = []
test_finished = False
async def coro(n):
@ -18,10 +19,12 @@ async def coro(n):
async def done():
global test_finished
while True:
if len(result) == COROS * ITERS:
#print(result)
assert result == list(range(COROS)) * ITERS
test_finished = True
return
yield
@ -32,3 +35,5 @@ for n in range(COROS):
loop.create_task(coro(n))
loop.run_until_complete(done())
assert test_finished