MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_recycle_on_invalidate

Method test_recycle_on_invalidate

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

Source from the content-addressed store, hash-verified

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