@@ -382,34 +382,34 @@ async def get_xact_id(con):
382
382
async def test_pool_connection_methods (self ):
383
383
async def test_fetch (pool ):
384
384
i = random .randint (0 , 20 )
385
- await asyncio .sleep (random .random () / 100 )
385
+ await asyncio .sleep (random .random () / 100 , loop = self . loop )
386
386
r = await pool .fetch ('SELECT {}::int' .format (i ))
387
387
self .assertEqual (r , [(i ,)])
388
388
return 1
389
389
390
390
async def test_fetchrow (pool ):
391
391
i = random .randint (0 , 20 )
392
- await asyncio .sleep (random .random () / 100 )
392
+ await asyncio .sleep (random .random () / 100 , loop = self . loop )
393
393
r = await pool .fetchrow ('SELECT {}::int' .format (i ))
394
394
self .assertEqual (r , (i ,))
395
395
return 1
396
396
397
397
async def test_fetchval (pool ):
398
398
i = random .randint (0 , 20 )
399
- await asyncio .sleep (random .random () / 100 )
399
+ await asyncio .sleep (random .random () / 100 , loop = self . loop )
400
400
r = await pool .fetchval ('SELECT {}::int' .format (i ))
401
401
self .assertEqual (r , i )
402
402
return 1
403
403
404
404
async def test_execute (pool ):
405
- await asyncio .sleep (random .random () / 100 )
405
+ await asyncio .sleep (random .random () / 100 , loop = self . loop )
406
406
r = await pool .execute ('SELECT generate_series(0, 10)' )
407
407
self .assertEqual (r , 'SELECT {}' .format (11 ))
408
408
return 1
409
409
410
410
async def test_execute_with_arg (pool ):
411
411
i = random .randint (0 , 20 )
412
- await asyncio .sleep (random .random () / 100 )
412
+ await asyncio .sleep (random .random () / 100 , loop = self . loop )
413
413
r = await pool .execute ('SELECT generate_series(0, $1)' , i )
414
414
self .assertEqual (r , 'SELECT {}' .format (i + 1 ))
415
415
return 1
@@ -431,7 +431,7 @@ async def run(N, meth):
431
431
432
432
async def test_pool_connection_execute_many (self ):
433
433
async def worker (pool ):
434
- await asyncio .sleep (random .random () / 100 )
434
+ await asyncio .sleep (random .random () / 100 , loop = self . loop )
435
435
await pool .executemany ('''
436
436
INSERT INTO exmany VALUES($1, $2)
437
437
''' , [
0 commit comments