MCPcopy
hub / github.com/psycopg/psycopg / test_closed_getconn

Function test_closed_getconn

tests/pool/test_pool_common_async.py:383–395  ·  view source on GitHub ↗
(pool_cls, dsn)

Source from the content-addressed store, hash-verified

381
382
383async def test_closed_getconn(pool_cls, dsn):
384 p = pool_cls(dsn, min_size=min_size(pool_cls), open=False)
385 await p.open()
386 assert not p.closed
387 async with p.connection():
388 pass
389
390 await p.close()
391 assert p.closed
392
393 with pytest.raises(pool.PoolClosed):
394 async with p.connection():
395 pass
396
397
398async def test_close_connection_on_pool_close(pool_cls, dsn):

Callers

nothing calls this directly

Calls 5

pool_clsFunction · 0.70
min_sizeFunction · 0.70
openMethod · 0.45
connectionMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected