MCPcopy
hub / github.com/psycopg/psycopg / test_configure_badstate

Function test_configure_badstate

tests/pool/test_pool_common_async.py:142–153  ·  view source on GitHub ↗
(pool_cls, dsn, caplog)

Source from the content-addressed store, hash-verified

140
141@pytest.mark.slow
142async def test_configure_badstate(pool_cls, dsn, caplog):
143 caplog.set_level(logging.WARNING, logger="psycopg.pool")
144
145 async def configure(conn):
146 await conn.execute("select 1")
147
148 async with pool_cls(dsn, min_size=min_size(pool_cls), configure=configure) as p:
149 with pytest.raises(pool.PoolTimeout):
150 await p.wait(timeout=0.5)
151
152 assert caplog.records
153 assert "INTRANS" in caplog.records[0].message
154
155
156@pytest.mark.slow

Callers

nothing calls this directly

Calls 3

pool_clsFunction · 0.70
min_sizeFunction · 0.70
waitMethod · 0.45

Tested by

no test coverage detected