@@ -79,7 +79,7 @@ async def test_bad_context_manager_usage(pool_creator):
7979@pytest .mark .run_loop
8080async def test_context_manager (pool_creator ):
8181 pool = await pool_creator (minsize = 10 , maxsize = 10 )
82- async with pool .get () as conn :
82+ async with pool .acquire () as conn :
8383 assert isinstance (conn , Connection )
8484 assert 9 == pool .freesize
8585 assert {conn } == pool ._used
@@ -101,7 +101,7 @@ async def test_initial_empty(pool_creator):
101101 assert 0 == pool .size
102102 assert 0 == pool .freesize
103103
104- async with pool .get ():
104+ async with pool .acquire ():
105105 assert 1 == pool .size
106106 assert 0 == pool .freesize
107107 assert 1 == pool .size
@@ -236,7 +236,7 @@ async def test_release_with_invalid_status_wait_release(pool_creator):
236236@pytest .mark .run_loop
237237async def test__fill_free (pool_creator , loop ):
238238 pool = await pool_creator (minsize = 1 )
239- async with pool .get ():
239+ async with pool .acquire ():
240240 assert 0 == pool .freesize
241241 assert 1 == pool .size
242242
@@ -256,7 +256,7 @@ async def test_connect_from_acquire(pool_creator):
256256 pool = await pool_creator (minsize = 0 )
257257 assert 0 == pool .freesize
258258 assert 0 == pool .size
259- async with pool .get ():
259+ async with pool .acquire ():
260260 assert 1 == pool .size
261261 assert 0 == pool .freesize
262262 assert 1 == pool .size
@@ -352,7 +352,7 @@ async def test_echo(pool_creator):
352352 pool = await pool_creator (echo = True )
353353 assert pool .echo
354354
355- async with pool .get () as conn :
355+ async with pool .acquire () as conn :
356356 assert conn .echo
357357
358358
@@ -481,7 +481,7 @@ async def test_cancelled_connection(pool_creator, loop):
481481 pool = await pool_creator (minsize = 0 , maxsize = 1 )
482482
483483 try :
484- async with pool .get () as conn :
484+ async with pool .acquire () as conn :
485485 curs = await conn .cursor ()
486486 # Cancel a cursor in the middle of execution, before it
487487 # could read even the first packet (SLEEP assures the
@@ -494,7 +494,7 @@ async def test_cancelled_connection(pool_creator, loop):
494494 except asyncio .CancelledError :
495495 pass
496496
497- async with pool .get () as conn :
497+ async with pool .acquire () as conn :
498498 cur2 = await conn .cursor ()
499499 res = await cur2 .execute ("SELECT 2 as value, 0 as xxx" )
500500 names = [x [0 ] for x in cur2 .description ]
@@ -508,7 +508,7 @@ async def test_cancelled_connection(pool_creator, loop):
508508@pytest .mark .run_loop
509509async def test_pool_with_connection_recycling (pool_creator , loop ):
510510 pool = await pool_creator (minsize = 1 , maxsize = 1 , pool_recycle = 3 )
511- async with pool .get () as conn :
511+ async with pool .acquire () as conn :
512512 cur = await conn .cursor ()
513513 await cur .execute ('SELECT 1;' )
514514 val = await cur .fetchone ()
@@ -517,7 +517,7 @@ async def test_pool_with_connection_recycling(pool_creator, loop):
517517 await asyncio .sleep (5 )
518518
519519 assert 1 == pool .freesize
520- async with pool .get () as conn :
520+ async with pool .acquire () as conn :
521521 cur = await conn .cursor ()
522522 await cur .execute ('SELECT 1;' )
523523 val = await cur .fetchone ()
@@ -528,13 +528,13 @@ async def test_pool_with_connection_recycling(pool_creator, loop):
528528async def test_pool_drops_connection_with_exception (pool_creator , loop ):
529529 pool = await pool_creator (minsize = 1 , maxsize = 1 )
530530
531- async with pool .get () as conn :
531+ async with pool .acquire () as conn :
532532 cur = await conn .cursor ()
533533 await cur .execute ('SELECT 1;' )
534534
535535 connection , = pool ._free
536536 connection ._writer ._protocol .connection_lost (IOError ())
537537
538- async with pool .get () as conn :
538+ async with pool .acquire () as conn :
539539 cur = await conn .cursor ()
540540 await cur .execute ('SELECT 1;' )
0 commit comments