MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_recycle_on_invalidate

Method test_recycle_on_invalidate

test/engine/test_pool.py:1536–1551  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1534
1535 @testing.requires.timing_intensive
1536 def test_recycle_on_invalidate(self):
1537 p = self._queuepool_fixture(pool_size=1, max_overflow=0)
1538 c1 = p.connect()
1539 c_ref = weakref.ref(c1.dbapi_connection)
1540 c1.close()
1541 c2 = p.connect()
1542 is_(c2.dbapi_connection, c_ref())
1543
1544 c2_rec = c2._connection_record
1545 p._invalidate(c2)
1546 assert c2_rec.dbapi_connection is None
1547 c2.close()
1548 time.sleep(0.5)
1549 c3 = p.connect()
1550
1551 is_not(c3.dbapi_connection, c_ref())
1552
1553 @testing.requires.timing_intensive
1554 def test_recycle_on_soft_invalidate(self):

Callers

nothing calls this directly

Calls 6

is_Function · 0.90
is_notFunction · 0.90
_queuepool_fixtureMethod · 0.80
_invalidateMethod · 0.80
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected