MCPcopy
hub / github.com/psycopg/psycopg / test_override_close

Function test_override_close

tests/pool/test_pool_async.py:1140–1153  ·  view source on GitHub ↗
(dsn)

Source from the content-addressed store, hash-verified

1138
1139
1140async def test_override_close(dsn):
1141 async with pool.AsyncConnectionPool(
1142 dsn, connection_class=ReturningConnection, min_size=2
1143 ) as p:
1144 await p.wait()
1145 assert len(p._pool) == 2
1146 conn = await p.getconn()
1147 assert not conn.closed
1148 assert len(p._pool) == 1
1149 await conn.close()
1150 assert not conn.closed
1151 assert len(p._pool) == 2
1152
1153 assert conn.closed
1154
1155
1156async def test_close_returns(dsn):

Callers

nothing calls this directly

Calls 3

waitMethod · 0.45
getconnMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected