MCPcopy
hub / github.com/psycopg/psycopg / test_del_no_warning

Function test_del_no_warning

tests/pool/test_pool.py:371–382  ·  view source on GitHub ↗
(dsn, recwarn, gc_collect)

Source from the content-addressed store, hash-verified

369
370
371def test_del_no_warning(dsn, recwarn, gc_collect):
372 p = pool.ConnectionPool(dsn, min_size=2, open=False)
373 p.open()
374 with p.connection() as conn:
375 conn.execute("select 1")
376
377 p.wait()
378 ref = weakref.ref(p)
379 del p
380 gc_collect()
381 assert not ref()
382 assert not recwarn, [str(w.message) for w in recwarn.list]
383
384
385def test_closed_putconn(dsn):

Callers

nothing calls this directly

Calls 5

openMethod · 0.95
connectionMethod · 0.95
waitMethod · 0.95
gc_collectFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected