MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_gc_conn

Method test_gc_conn

test/ext/asyncio/test_engine.py:1623–1644  ·  view source on GitHub ↗
(self, testing_engine)

Source from the content-addressed store, hash-verified

1621 @testing.requires.predictable_gc
1622 @async_test
1623 async def test_gc_conn(self, testing_engine):
1624 ReversibleProxy._proxy_objects.clear()
1625
1626 async_engine = AsyncEngine(testing.db)
1627
1628 eq_(len(ReversibleProxy._proxy_objects), 1)
1629
1630 async with async_engine.connect() as conn:
1631 eq_(len(ReversibleProxy._proxy_objects), 2)
1632
1633 async with conn.begin() as trans:
1634 eq_(len(ReversibleProxy._proxy_objects), 3)
1635
1636 del trans
1637
1638 del conn
1639
1640 eq_(len(ReversibleProxy._proxy_objects), 1)
1641
1642 del async_engine
1643
1644 eq_(len(ReversibleProxy._proxy_objects), 0)
1645
1646 def test_regen_conn_but_not_engine(self, async_engine):
1647 with async_engine.sync_engine.connect() as sync_conn:

Callers

nothing calls this directly

Calls 5

connectMethod · 0.95
AsyncEngineClass · 0.90
eq_Function · 0.90
clearMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected