MCPcopy
hub / github.com/psycopg/psycopg / test_check_max_lifetime

Function test_check_max_lifetime

tests/pool/test_pool.py:854–863  ·  view source on GitHub ↗
(dsn)

Source from the content-addressed store, hash-verified

852
853@pytest.mark.slow
854def test_check_max_lifetime(dsn):
855 with pool.ConnectionPool(dsn, min_size=1, max_lifetime=0.2) as p:
856 with p.connection() as conn:
857 pid = conn.info.backend_pid
858 with p.connection() as conn:
859 assert conn.info.backend_pid == pid
860 sleep(0.3)
861 p.check()
862 with p.connection() as conn:
863 assert conn.info.backend_pid != pid
864
865
866@pytest.mark.slow

Callers

nothing calls this directly

Calls 2

connectionMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected